arduino:lcd

This is an old revision of the document!


LCD Display

Notes:

  • I2C address is actually 0x20, not 0x27
  • I'm using the New LiquidCrystal library
  • Need pull-up resistors on SDA and SCL lines (A4 & A5 pins)

Test Code

test.a
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
 
#define lcdAddr 0x20 // set the address of the I2C device the LCD is connected to
 
// create an lcd instance with correct constructor for how the lcd is wired to the I2C chip
LiquidCrystal_I2C lcd(lcdAddr, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); // addr, EN, RW, RS, D4, D5, D6, D7, Backlight, POLARITY
 
void setup()
{
  lcd.begin(8,2);  // initialize the lcd as 20x4 (16,2 for 16x2)
}
 
void loop()
{
  lcd.clear();
  delay(200);
  lcd.home ();
  lcd.print("12345678");
  lcd.setCursor (0,2);
  lcd.print("ABCDEFGH");
  delay (1800);
 
}
  • arduino/lcd.1364486615.txt.gz
  • Last modified: 2014/11/13 10:50
  • (external edit)