LCD Display

MJKDZ I2C board from eBay.

Notes:

Test Code

LCD_test.ino
#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(16,2);  // initialize the lcd as 20x4 (16,2 for 16x2)
  lcd.clear();
  //  lcd.home ();
  //  lcd.print("123456789012345678");
  //  lcd.setCursor (0,1);
  //  lcd.print("ABCDEFGHIJKLMNOP");
 
  lcd.setCursor (0,0);
  lcd.print("Count:");
  lcd.setBacklight(1);
}
 
int i=0;
void loop()
{
  lcd.setCursor (7,0);
  lcd.print(i++);
  delay (100);
 
}

Note: Code for Raspberry PI

Special characters for the HD44780

HexCharacter
0xE4microμ
0xF4OhmΩ
0xDFdegreeº
 
arduino/lcd.txt · Last modified: 2014/11/13 10:50 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki