Now we must upload some sketch to the Arduino to talk to the LCD. Luckily the LiquidCrystal library is already built in. So we just need to load one of the examples and modify it for the pins we used.
If you've changed the pins, you'll want to make a handy table so you can update the sketch properly.
LCD pin name | RS | EN | DB4 | DB5 | DB6 | DB7 |
Arduino pin # | 7 | 8 | 9 | 10 | 11 | 12 |
Open up the File→Examples→LiquidCrystal→HelloWorld example sketch
Now we'll need to update the pins. Look for this line:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
To match the pin table we just made.
Now you can compile and upload the sketch.
Multiple Lines
One thing you'll want to watch for is how the LCD handles large messages and multiple lines. For example if you changed this line:lcd.print("hello, world!");
lcd.print("hello, world! this is a long long message");
Text editor powered by tinymce.