Arduino – Managing multiple 4x20 character displays on an i2c bus
Manage multiple 4x20 character I2C bus LCD displays:
(Download from here: i2clcd_minta.ino)
#include <LiquidCrystal_I2C.h>
int Lcd1 = 0x26;// Display addresses. Based on the table, you can solder it on the i2c module by soldering it in the right place.
int Lcd2 = 0x25;
int Lcd3 = 0x23;
/* I2C display addresses:
A0 A1 A2 HEX Address
1 1 1 0x27
0 1 1 0x26
1 0 1 0x25
0 0 1 0x24
1 1 0 0x23
0 1 0 0x22
1 0 0 0x21
0 0 0 0x20
*/
LiquidCrystal_I2C lcd1(Lcd1, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd2(Lcd2, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd3(Lcd3, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup() {
lcd1.init();//lcd1 initialisation
lcd1.backlight(); // Backlight On
lcd1.setCursor(0, 0); //set cursor to the first character in line 0
lcd1.print(F("LCD1"));// print text to LCD
lcd2.init();//lcd2 initialisation
lcd2.backlight(); // Backlight On
lcd2.setCursor(0, 0); //set cursor to the first character in line 0
lcd2.print(F("LCD2"));// print text to LCD
lcd3.init();//lcd3 initialisation
lcd3.backlight(); // Backlight On
lcd3.setCursor(0, 0); //set cursor to the first character in line 0
lcd3.print(F("LCD3"));// print text to LCD
delay(1000);
}
void loop() {
}