<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=1602_LCD</id>
	<title>1602 LCD - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=1602_LCD"/>
	<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=1602_LCD&amp;action=history"/>
	<updated>2026-07-21T20:08:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://w.electrodragon.com/w/index.php?title=1602_LCD&amp;diff=20994&amp;oldid=prev</id>
		<title>Chao: /* LCD2USB */</title>
		<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=1602_LCD&amp;diff=20994&amp;oldid=prev"/>
		<updated>2018-12-20T09:15:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;LCD2USB&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 1602 Display ==&lt;br /&gt;
=== Pin Definition ===&lt;br /&gt;
[[File:1602 Display 1.jpg|thumbnail]]&lt;br /&gt;
* pin1 --- (GND)&lt;br /&gt;
* pin2 --- (VDD)&lt;br /&gt;
* pin3 --- (Display Contrast Bias, + resistor 1.5K-2.2K)&lt;br /&gt;
* pin 4 (RS) --- Command / Data Selection&lt;br /&gt;
* pin 5 (R/W) ---  Read / Write Selection&lt;br /&gt;
* pin 6 (Enable) ---  Enable&lt;br /&gt;
* D0-D7 --- Data Pins&lt;br /&gt;
* BLA --- Back light positive&lt;br /&gt;
* BLK --- Back Light negative&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1602 LCD using PCF8574 IO expander ==&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* A4 - SDA&lt;br /&gt;
* A5 - SDL&lt;br /&gt;
* A-VCC: Connect for blacklight&lt;br /&gt;
* I2C Address, set the IIC Address, default is 0X27&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:2004_Wiring.JPG|Wire with 2004&lt;br /&gt;
File:Demo_iic_1602.JPG| Works with 1602&lt;br /&gt;
File:Demo_iic_2004.JPG|Works with 2004&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Demo Code and library ===&lt;br /&gt;
* [[:File:1602_IIC_Converter_Board_For_1602_and_2004_(Back-Light_Adjustable).zip|Arduino Demo Code]]&lt;br /&gt;
* https://github.com/marcoschwartz/LiquidCrystal_I2C&lt;br /&gt;
* Download from github library, arduino library has &amp;quot;only display one character&amp;quot; issue&lt;br /&gt;
=== Schematic ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:1602 IIC backpack Schematic.png&lt;br /&gt;
FIle:1602_IIC_schematic_R2.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use with MCP23008 IO expander ==&lt;br /&gt;
=== Introduction  ===&lt;br /&gt;
&lt;br /&gt;
LCDs are a fun and easy way to have your microcontroller project talk back to you. Character LCDs are common, and easy to get, available in tons of colors and sizes.But it find that the number of pins necessary to control the LCD can be restrictive, especially with ambitious projects.&amp;lt;br /&amp;gt;&lt;br /&gt;
The common charctic LCD need more than 6 pins for controlling. With the limited pin resources, your project may be out of resources using normal LCD shield. Here we provide the IIC LCD module, you only need '''2 lines''' (I2C) to display the information.&amp;lt;br /&amp;gt;&lt;br /&gt;
By using simple i2c and SPI input/output expanders we have reduced the number of pins (only 2 pins are needed for i2c) while still making it easy to interface with the LCD.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
* Supply voltage: +5 V&lt;br /&gt;
* Supports two protocols IIC/I2C and SPI&lt;br /&gt;
* With backlight and contrast adjustment potentiometer&lt;br /&gt;
* Including IIC and SPI Terminals, you can use ordinary wires to connect, do not need to purchase a special adapter cable, convenient for enthusiasts.&lt;br /&gt;
*Work with any 'standard'16x2 character LCD &lt;br /&gt;
*LCD Display Mode: STN, Positive, Transflective&lt;br /&gt;
*Display Color: Deep Blue/ Yellow Green&lt;br /&gt;
*Viewing Angle: 6H&lt;br /&gt;
*Outline Dimension: 80*36*15.8 MAX&lt;br /&gt;
&lt;br /&gt;
=== How it looks ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Arduino_IIC_module_2.jpg&lt;br /&gt;
File:1602_IIC_2.jpg&lt;br /&gt;
File:Arduino_IIC_module_2_enable_SPI.jpg| enable SPI&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Schematic  ===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:LCD IICSPI 05.jpg&lt;br /&gt;
File:MCP23008.jpg|MCP23008&lt;br /&gt;
File:1602-23008.png| version 2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pin definition and Rating  ===&lt;br /&gt;
* IIC Pin definition&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin &lt;br /&gt;
! # &lt;br /&gt;
! Pad Type &lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; | GND&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; | 1&lt;br /&gt;
| width=&amp;quot;350px&amp;quot; | VSS&lt;br /&gt;
| width=&amp;quot;450px&amp;quot; | Ground port  &lt;br /&gt;
|-&lt;br /&gt;
| VCC&lt;br /&gt;
| 2&lt;br /&gt;
| 3.3V&lt;br /&gt;
| Integrated 3.3V(+)supply with on-chip linear regulator output within 3.15-3.3V&lt;br /&gt;
|-&lt;br /&gt;
| SDA&lt;br /&gt;
| 3&lt;br /&gt;
| Data&lt;br /&gt;
| Data&lt;br /&gt;
|-&lt;br /&gt;
| SCL&lt;br /&gt;
| 4&lt;br /&gt;
| Clock&lt;br /&gt;
| Clock&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* SPI Pin definition &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin &lt;br /&gt;
! # &lt;br /&gt;
! Pad Type &lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; | GND&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; | 1&lt;br /&gt;
| width=&amp;quot;350px&amp;quot; | VSS&lt;br /&gt;
| width=&amp;quot;450px&amp;quot; | Ground port  &lt;br /&gt;
|-&lt;br /&gt;
| VCC&lt;br /&gt;
| 2&lt;br /&gt;
| 3.3V&lt;br /&gt;
| Integrated 3.3V(+)supply with on-chip linear regulator output within 3.15-3.3V&lt;br /&gt;
|-&lt;br /&gt;
| C&lt;br /&gt;
| 3&lt;br /&gt;
| Clock&lt;br /&gt;
| Clock&lt;br /&gt;
|-&lt;br /&gt;
| D&lt;br /&gt;
| 4&lt;br /&gt;
| Data &lt;br /&gt;
| Data&lt;br /&gt;
|-&lt;br /&gt;
| L&lt;br /&gt;
| 5&lt;br /&gt;
| Latch &lt;br /&gt;
| Latch&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Programming  ===&lt;br /&gt;
'''IIC mode ''' connect the CLK pin to '''Analog 5 (i2c SCL pin)''' and DAT to''' Analog 4 (i2c SDA pin)'''. Connect the 5V and ground pins to respective power pins.&lt;br /&gt;
&lt;br /&gt;
'''SPI mode '''connect the CLK pin to '''Digital 2 (SPI Clock pin)''' and D to''' Digital 3 (SPI DATA pin)''' and L to '''Digital 4 (SPI Latch pin)'''. Connect the 5V and ground pins to respective power pins.&lt;br /&gt;
&lt;br /&gt;
The Library is base on [http://hostfile.org/LiquidTWI.rar Adafruit's IICLibrary], we had accorded our hardware do the appropriate changes. And you can easy choose '''SPI mode''' or '''IIC mode''' by the '''Switch'''&lt;br /&gt;
&lt;br /&gt;
Includes important code snippet. &lt;br /&gt;
Demo code like : &lt;br /&gt;
&lt;br /&gt;
==== IIC Mode ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:1050px;border:1px dashed #808080;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;arduino&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 Demonstration sketch for Adafruit i2c/SPI LCD backpack&lt;br /&gt;
 using MCP23008 I2C expander&lt;br /&gt;
 ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )&lt;br /&gt;
&lt;br /&gt;
 This sketch prints &amp;quot;Hello World!&amp;quot; to the LCD&lt;br /&gt;
 and shows the time.&lt;br /&gt;
 &lt;br /&gt;
  The circuit:&lt;br /&gt;
 * 5V to Arduino 5V pin&lt;br /&gt;
 * GND to Arduino GND pin&lt;br /&gt;
 * CLK to Analog #5&lt;br /&gt;
 * DAT to Analog #4&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
// include the library code:&lt;br /&gt;
#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;
#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Connect via i2c, default address #0 (A0-A2 not jumpered)&lt;br /&gt;
LiquidCrystal lcd(0);&lt;br /&gt;
&lt;br /&gt;
void setup() { &lt;br /&gt;
  // set up the LCD's number of rows and columns: &lt;br /&gt;
  lcd.begin(16, 2);&lt;br /&gt;
  // Print a message to the LCD.&lt;br /&gt;
  lcd.print(&amp;quot;hello, world!&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
  // set the cursor to column 0, line 1&lt;br /&gt;
  // (note: line 1 is the second row, since counting begins with 0):&lt;br /&gt;
  lcd.setCursor(0, 1);&lt;br /&gt;
  // print the number of seconds since reset:&lt;br /&gt;
  lcd.print(millis()/1000);&lt;br /&gt;
&lt;br /&gt;
  lcd.setBacklight(HIGH);&lt;br /&gt;
  delay(500);&lt;br /&gt;
  lcd.setBacklight(LOW);&lt;br /&gt;
  delay(500);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== SPI Mode ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:1050px;border:1px dashed #808080;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;arduino&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 Demonstration sketch for Adafruit i2c/SPI LCD backpack&lt;br /&gt;
 using 74HC595 SPI expander&lt;br /&gt;
 ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )&lt;br /&gt;
&lt;br /&gt;
 This sketch prints &amp;quot;Hello World!&amp;quot; to the LCD&lt;br /&gt;
 and shows the time.&lt;br /&gt;
 &lt;br /&gt;
  The circuit:&lt;br /&gt;
 * 5V to Arduino 5V pin&lt;br /&gt;
 * GND to Arduino GND pin&lt;br /&gt;
 * CLK to Digital 2&lt;br /&gt;
 * DAT to Digital 3&lt;br /&gt;
 * LAT to Digital 4&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// include the library code:&lt;br /&gt;
#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;
#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Connect via SPI. Data pin is #3, Clock is #2 and Latch is #4&lt;br /&gt;
LiquidCrystal lcd(3, 2, 4);&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  // set up the LCD's number of rows and columns: &lt;br /&gt;
  lcd.begin(16, 2);&lt;br /&gt;
  // Print a message to the LCD.&lt;br /&gt;
  lcd.print(&amp;quot;hello, world!&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
  // set the cursor to column 0, line 1&lt;br /&gt;
  // (note: line 1 is the second row, since counting begins with 0):&lt;br /&gt;
  lcd.setCursor(0, 1);&lt;br /&gt;
  // print the number of seconds since reset:&lt;br /&gt;
  lcd.print(millis()/1000);&lt;br /&gt;
&lt;br /&gt;
  lcd.setBacklight(HIGH);&lt;br /&gt;
  delay(500);&lt;br /&gt;
  lcd.setBacklight(LOW);&lt;br /&gt;
  delay(500);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 1602 LCD + Keypad Shield ==&lt;br /&gt;
===Introduction===&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File: LCD&amp;amp;KeyPad Shield.jpg&lt;br /&gt;
File: Arduino Shield8.png&lt;br /&gt;
File: LCD Shield.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''LCD Keypad shield'' is developed for Arduino compatible boards, to provide a user-friendly interface that allows users to go through the menu, make selections etc. It consists of a 1602 white character blue backlight LCD. The keypad consists of 5 keys — select, up, right, down and left. To save the digital IO pins, the keypad interface uses only one ADC channel. The key value is read through a 5 stage voltage divider.&lt;br /&gt;
&lt;br /&gt;
===Pin Allocation===&lt;br /&gt;
*  Analog 0 - Button (select, up, right, down and left), DO NOT use this pin&lt;br /&gt;
* Digital 4 - 7 - DB 4 - 7&lt;br /&gt;
* Digital 8 - RS (Data or Signal Display Selection)&lt;br /&gt;
* Digital 9 - Enable&lt;br /&gt;
* Digital 10 - Backlight Control&lt;br /&gt;
=== Arduino demo code ===&lt;br /&gt;
====Demo Code using button functions ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Arduino&amp;quot;&amp;gt;&lt;br /&gt;
 #include &amp;lt;SPI.h&amp;gt;  // Add a import library line if you get error message:&lt;br /&gt;
#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);           // select the pins used on the LCD panel&lt;br /&gt;
&lt;br /&gt;
// define some values used by the panel and buttons&lt;br /&gt;
int lcd_key     = 0;&lt;br /&gt;
int adc_key_in  = 0;&lt;br /&gt;
&lt;br /&gt;
#define btnRIGHT  0&lt;br /&gt;
#define btnUP     1&lt;br /&gt;
#define btnDOWN   2&lt;br /&gt;
#define btnLEFT   3&lt;br /&gt;
#define btnSELECT 4&lt;br /&gt;
#define btnNONE   5&lt;br /&gt;
&lt;br /&gt;
int read_LCD_buttons(){               // read the buttons&lt;br /&gt;
    adc_key_in = analogRead(0);       // read the value from the sensor &lt;br /&gt;
&lt;br /&gt;
    // my buttons when read are centered at these valies: 0, 144, 329, 504, 741&lt;br /&gt;
    // we add approx 50 to those values and check to see if we are close&lt;br /&gt;
    // We make this the 1st option for speed reasons since it will be the most likely result&lt;br /&gt;
&lt;br /&gt;
    if (adc_key_in &amp;gt; 1000) return btnNONE; &lt;br /&gt;
&lt;br /&gt;
    // For V1.1 us this threshold&lt;br /&gt;
    if (adc_key_in &amp;lt; 50)   return btnRIGHT;  &lt;br /&gt;
    if (adc_key_in &amp;lt; 250)  return btnUP; &lt;br /&gt;
    if (adc_key_in &amp;lt; 450)  return btnDOWN; &lt;br /&gt;
    if (adc_key_in &amp;lt; 650)  return btnLEFT; &lt;br /&gt;
    if (adc_key_in &amp;lt; 850)  return btnSELECT;  &lt;br /&gt;
&lt;br /&gt;
   // For V1.0 comment the other threshold and use the one below:&lt;br /&gt;
   /*&lt;br /&gt;
     if (adc_key_in &amp;lt; 50)   return btnRIGHT;  &lt;br /&gt;
     if (adc_key_in &amp;lt; 195)  return btnUP; &lt;br /&gt;
     if (adc_key_in &amp;lt; 380)  return btnDOWN; &lt;br /&gt;
     if (adc_key_in &amp;lt; 555)  return btnLEFT; &lt;br /&gt;
     if (adc_key_in &amp;lt; 790)  return btnSELECT;   &lt;br /&gt;
   */&lt;br /&gt;
&lt;br /&gt;
    return btnNONE;                // when all others fail, return this.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void setup(){&lt;br /&gt;
   lcd.begin(16, 2);               // start the library&lt;br /&gt;
   lcd.setCursor(0,0);             // set the LCD cursor   position &lt;br /&gt;
   lcd.print(&amp;quot;Push the buttons&amp;quot;);  // print a simple message on the LCD&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop(){&lt;br /&gt;
   lcd.setCursor(9,1);             // move cursor to second line &amp;quot;1&amp;quot; and 9 spaces over&lt;br /&gt;
   lcd.print(millis()/1000);       // display seconds elapsed since power-up&lt;br /&gt;
&lt;br /&gt;
   lcd.setCursor(0,1);             // move to the begining of the second line&lt;br /&gt;
   lcd_key = read_LCD_buttons();   // read the buttons&lt;br /&gt;
&lt;br /&gt;
   switch (lcd_key){               // depending on which button was pushed, we perform an action&lt;br /&gt;
&lt;br /&gt;
       case btnRIGHT:{             //  push button &amp;quot;RIGHT&amp;quot; and show the word on the screen&lt;br /&gt;
            lcd.print(&amp;quot;RIGHT &amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
       }&lt;br /&gt;
       case btnLEFT:{&lt;br /&gt;
             lcd.print(&amp;quot;LEFT   &amp;quot;); //  push button &amp;quot;LEFT&amp;quot; and show the word on the screen&lt;br /&gt;
             break;&lt;br /&gt;
       }    &lt;br /&gt;
       case btnUP:{&lt;br /&gt;
             lcd.print(&amp;quot;UP    &amp;quot;);  //  push button &amp;quot;UP&amp;quot; and show the word on the screen&lt;br /&gt;
             break;&lt;br /&gt;
       }&lt;br /&gt;
       case btnDOWN:{&lt;br /&gt;
             lcd.print(&amp;quot;DOWN  &amp;quot;);  //  push button &amp;quot;DOWN&amp;quot; and show the word on the screen&lt;br /&gt;
             break;&lt;br /&gt;
       }&lt;br /&gt;
       case btnSELECT:{&lt;br /&gt;
             lcd.print(&amp;quot;SELECT&amp;quot;);  //  push button &amp;quot;SELECT&amp;quot; and show the word on the screen&lt;br /&gt;
             break;&lt;br /&gt;
       }&lt;br /&gt;
       case btnNONE:{&lt;br /&gt;
             lcd.print(&amp;quot;NONE  &amp;quot;);  //  No action  will show &amp;quot;None&amp;quot; on the screen&lt;br /&gt;
             break;&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Demo Code Using A1 pin to read temperature from sensor LM35 ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Arduino&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);        // select the pins used on the LCD panel&lt;br /&gt;
&lt;br /&gt;
unsigned long tepTimer ;    &lt;br /&gt;
&lt;br /&gt;
void setup(){ &lt;br /&gt;
    lcd.begin(16, 2);                       // start the library&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop(){ &lt;br /&gt;
    lcd.setCursor(0, 0);                   // set the LCD cursor   position &lt;br /&gt;
    int val;                               // variable to store the value coming from the analog pin &lt;br /&gt;
    double data;                           // variable to store the temperature value coming from the conversion formula&lt;br /&gt;
    val=analogRead(1);                     // read the analog in value:&lt;br /&gt;
    data = (double) val * (5/10.24);       // temperature conversion formula&lt;br /&gt;
    &lt;br /&gt;
    if(millis() - tepTimer &amp;gt; 500){         // output a temperature value per 500ms &lt;br /&gt;
             tepTimer = millis();&lt;br /&gt;
&lt;br /&gt;
             // print the results to the lcd&lt;br /&gt;
             lcd.print(&amp;quot;T: &amp;quot;);               &lt;br /&gt;
             lcd.print(data);             &lt;br /&gt;
             lcd.print(&amp;quot;C&amp;quot;);              &lt;br /&gt;
     } &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use LiquidCrystal library ==&lt;br /&gt;
&lt;br /&gt;
=== Function Explanation ===&lt;br /&gt;
'''LiquidCrystal(rs, enable, d4, d5, d6, d7)''' - Creates a variable of type LiquidCrystal. The display can be controlled using 4 or 8 data lines. If the former, omit the pin numbers for d0 to d3 and leave those lines unconnected. The RW pin can be tied to ground instead of connected to a pin on the Arduino; if so, omit it from this function's parameters. for example:&lt;br /&gt;
 LiquidCrystal lcd(8, 9, 4, 5, 6, 7);&lt;br /&gt;
&lt;br /&gt;
'''lcd.begin(cols, rows)''' - Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display. begin() needs to be called before any other LCD library commands.for example:&lt;br /&gt;
 lcd.begin(16, 2);  &lt;br /&gt;
&lt;br /&gt;
'''lcd.setCursor(col,row)''' - Set the location at which subsequent text written to the LCD will be displayed. for example:&lt;br /&gt;
 lcd.setCursor(0,0);&lt;br /&gt;
&lt;br /&gt;
'''lcd.print(data)''' - Prints text to the LCD.for example:&lt;br /&gt;
 lcd.print(&amp;quot;hello, world!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''lcd.write(data)''' - Write a character to the LCD. &lt;br /&gt;
&lt;br /&gt;
'''More function can see:'''&lt;br /&gt;
*[http://arduino.cc/en/Reference/LiquidCrystal LiquidCrystal Library]&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [[File:SPI_IIC_LCD_MCP23008.zip]]&lt;br /&gt;
* [http://www.arduino.cc/playground/Code/LCD Arduino reference LCD Library]&lt;br /&gt;
&lt;br /&gt;
== LCD2USB ==&lt;br /&gt;
* [https://github.com/harbaum/LCD2USB Based on original project here]&lt;br /&gt;
* Upload firmware by: &lt;br /&gt;
 avrdude -c stk200 -p atmega8 -U lfuse:w:0x9f:m -U hfuse:w:0xc9:m -U flash:w:firmware-avrusb.hex&lt;br /&gt;
* install driver libusb-win32 in windows&lt;br /&gt;
* Hardware shematic please see [[:File:Lcd2usb-sch.png|here]].&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
* in raspberry pi, is driver free, use with python  -&amp;gt; sudo pip install lcd2usb, also install psutil&lt;br /&gt;
* Demo code avaialble [[:File:USBLCD1.zip|here]] and testing code [[:File:USBLCD.zip|here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category: char LCDs]]&lt;/div&gt;</summary>
		<author><name>Chao</name></author>
	</entry>
</feed>