/*
20 character 4 line I2C Display
Backpack Interface labelled "A0 A1 A2" at lower right.
Angebautes Interface "YwRobot Arduino LCM1602 IIC V1"
Arduino UNO sowie Mega adresse = 0x3F
Kommunikation Pins beim Uno: SDA = A4 / SCL = A5
Kommunikationspins beim Mega SDA = 20 / SCL = 21
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Kommunikation mit Arduino IDE
#include <LiquidCrystal_I2C.h> // LCD Display
// Die LCD-Adresse Uno 0x3f for a 20 chars 4 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
void setup() {
Serial.begin(9600); // Used to type in characters
lcd.begin(20,4); // initialize the lcd for 20 chars 4 lines, turn on backlight
// ------- Drei mal Display Licht ein - aus -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // Blinken Ende
//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0,0); //Start at character 4 on line 0
lcd.print("Hallo Welt :-)");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Display = gestartet");
delay(3000);
lcd.clear();
delay(1000);
lcd.setCursor(0,0);
lcd.print("Haaaalloooooo :-)");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Arduino Uno Com.");
delay(1000);
lcd.setCursor(0,2); //Start at character 0 on line 0
lcd.print("Serielle Daten");
delay(1000);
lcd.setCursor(0,3);
lcd.print("Type 4x20 display...");
delay(100);
// Lösche das Display
lcd.clear();
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
{
// Wenn Zeichen über den seriellen Port eintreffen...
if (Serial.available()) {
// Warte bis die gesamte Nachricht ankommen ist
// Lese alle Verfügbaren Zeichen
while (Serial.available() > 0) {
// Und schreibe sie auf das Display
lcd.write(Serial.read());
}
}
}
}/* --(end main loop )-- */
/* ( THE END ) */