Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pinout:
- GND => GND
- VCC => 5V
- SDA => A4
- SCL => A5
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- #define BACKLIGHT_PIN 13
- // LiquidCrystal_I2C lcd(0x27); // Set the LCD I2C address
- LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
- void setup()
- {
- // Switch on the backlight
- pinMode ( BACKLIGHT_PIN, OUTPUT );
- digitalWrite ( BACKLIGHT_PIN, HIGH );
- lcd.init();
- lcd.begin(16,2);
- lcd.clear();
- lcd.backlight();
- lcd.setCursor(0,0); //Start at character 0 on line 0
- lcd.print("Welcome ");
- lcd.setCursor(0,1);
- lcd.print("to the I2C LCD");
- // lcd.noBacklight();
- }
- void loop()
- {
- delay (200);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement