You only need 2 lines to display the informaton on the LCD 20x4 LCD i2c Modul, thanks to I2C interface!
Specifications
- 20x4 LCD, White on Blue
- I2C Address: 0x27
- Supply voltage: 5V
- Interface: GND,VCC,SDA,SCL
Pinout
Board | I2C / TWI pins |
Uno, Ethernet | A4 (SDA), A5 (SCL) |
Mega2560 | 20 (SDA), 21 (SCL) |
Leonardo | 2 (SDA), 3 (SCL) |
Due | 20 (SDA), 21 (SCL), SDA1, SCL1 |
Yun | 2 (SDA), 3 (SCL) |
Documents
#include
#include // LiquidCrystal_I2C lcd(0x27, 20, 4); // DFRobot
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // New LiquidCrystalvoid setup()
{
// lcd.init(); // DFRobot
lcd.begin(20,4); // New LiquidCrystallcd.setCursor(0,1);
lcd.print("www.nikolaus-");
delay(2000);lcd.setCursor(8,2);
lcd.print("lueneburg.de");
delay(2000);
lcd.noBacklight();
lcd.clear();
delay(2000);lcd.backlight();
delay(500);
}void loop()
{
DisplayText(); // Scrolling Text Function
}//////////////////
// Scolling Textconst int LCD_COLS = 20; // cols per line
int LCD_START = 0; // start position for textchar LCD_TEXT[] = "Scrolling Text - www.nikolaus-lueneburg.de - Scrolling Text";void DisplayText()
{
int TEXT_LEN = (sizeof(LCD_TEXT) / sizeof(char)) - 1;
int LCD_LIMIT = TEXT_LEN - LCD_COLS;
{
if (LCD_START > LCD_LIMIT)
{
delay(1500);
for(int i = 0; i