Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| arduino:lcd [2013/03/28 08:57] – created photonicsguy | arduino:lcd [2014/11/13 10:50] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== MJKDZ I2C board from eBay. ===== | ===== MJKDZ I2C board from eBay. ===== | ||
| - | |||
| - | * [[http:// | ||
| Notes: | Notes: | ||
| - | * I2C address is actually 0x20, not 0x27 | + | * [[http:// |
| + | * * I2C address is actually 0x20, not 0x27 | ||
| * I'm using the [[https:// | * I'm using the [[https:// | ||
| * Need pull-up resistors on SDA and SCL lines (A4 & A5 pins) | * Need pull-up resistors on SDA and SCL lines (A4 & A5 pins) | ||
| + | Test Code | ||
| + | <code c LCD_test.ino># | ||
| + | #include < | ||
| + | |||
| + | #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, | ||
| + | |||
| + | void setup() | ||
| + | { | ||
| + | lcd.begin(16, | ||
| + | lcd.clear(); | ||
| + | // lcd.home (); | ||
| + | // lcd.print(" | ||
| + | // lcd.setCursor (0,1); | ||
| + | // lcd.print(" | ||
| + | |||
| + | lcd.setCursor (0,0); | ||
| + | lcd.print(" | ||
| + | lcd.setBacklight(1); | ||
| + | } | ||
| + | |||
| + | int i=0; | ||
| + | void loop() | ||
| + | { | ||
| + | lcd.setCursor (7,0); | ||
| + | lcd.print(i++); | ||
| + | delay (100); | ||
| + | |||
| + | }</ | ||
| + | |||
| + | |||
| + | Note: [[http:// | ||
| + | |||
| + | ===== Special characters for the HD44780 ===== | ||
| + | ^Hex^Character^ | ||
| + | |0xE4|micro|μ| | ||
| + | |0xF4|Ohm|Ω| | ||
| + | |0xDF|degree|º| | ||