Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
arduino:lcd [2013/03/28 09:04] – photonicsguy | arduino:lcd [2014/04/07 11:54] – photonicsguy | ||
---|---|---|---|
Line 12: | Line 12: | ||
#define lcdAddr 0x20 // set the address of the I2C device the LCD is connected to | #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 | // create an lcd instance with correct constructor for how the lcd is wired to the I2C chip | ||
LiquidCrystal_I2C lcd(lcdAddr, | LiquidCrystal_I2C lcd(lcdAddr, | ||
Line 18: | Line 17: | ||
void setup() | void setup() | ||
{ | { | ||
- | lcd.begin(8,2); // initialize the lcd as 20x4 (16,2 for 16x2) | + | lcd.begin(16,2); // initialize the lcd as 20x4 (16,2 for 16x2) |
+ | 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() | void loop() | ||
{ | { | ||
- | | + | lcd.setCursor (7,0); |
- | delay(200); | + | lcd.print(i++); |
- | lcd.home (); | + | delay (100); |
- | lcd.print(" | + | |
- | | + | |
- | lcd.print(" | + | |
- | delay (1800); | + | |
- | + | ||
}</ | }</ | ||
+ | |||
+ | |||
+ | Note: [[http:// | ||
+ | |||
+ | ===== Special characters for the HD44780 ===== | ||
+ | ^Hex^Character^ | ||
+ | |0xE4|micro|μ| | ||
+ | |0xF4|Ohm|Ω| | ||
+ | |0xDF|degree|º| | ||
+ |