Dumb question but just want to be sure. I'm thinking of getting a 20x4 LCD to go along with the 16x2 i already have. So am i safe to assume that i can hook like the above examples?
I figure all i'd have to do is declare the 2 screen in setup correctly. For example:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd2(12, 10, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of rows and columns:
[glow] lcd.begin(20, 4);[/glow]
// Print a message to the LCD.
lcd.print("hello, world!");
[glow]lcd2.begin(16, 2);[/glow]
// Print a message to the LCD.
lcd2.print("hey, world!");
lcd2.setCursor(0, 1);
lcd2.print("it works!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
Like i said stupid question but just want to be sure.