Navigation

LCD 16x2 + I2C IIC TWI SPI MODULE

Arduino - I2C IIC TWI SPI MODULE
5V - 5V
SDA - SDA
SCL - SCL
GND - GND


#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd1(0x20,16,2);  // set the LCD address of the first lcd to 0x20 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd2(0x21,16,2);  // set the LCD address of the second lcd to 0x21 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd3(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display
 
void setup()
{
  lcd1.init();                      // initialize the first lcd 
  lcd2.init();                      // initialize the second lcd 
  lcd3.init();                      // 

  lcd1.backlight();
  lcd1.clear();
  delay(100);
}
 
void loop()
{
  lcd1.setCursor(0,0);
  lcd1.print(" Hello world!");
  delay(1000);
  lcd1.setCursor(0,1);
  lcd1.print("how are you?");
  delay(3000);
lcd1.clear();
  lcd1.setCursor(0,0);
  lcd1.print("Good?");
  delay(1000);
  lcd1.setCursor(0,1);
  lcd1.print("OK, bye!");
  delay(3000);
lcd1.clear();
}