/* Laurien Hofkens 30/09/2024
* LCD teller (opdrachte 1.1 classroom displays)
*/
#include <Wire.h> // Library voor I2C
#include <LiquidCrystal_I2C.h> // Library voor LCD
int teller=0; // Declareer teller als geheel getal (integer)
LiquidCrystal_I2C lcd(0x27,16,2); // Adres 0x27 of 0x3F, aantal karakters 16 of 20, aantal rijen 2 of4
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight(); // Achtergrond verlichting aanzetten
lcd.setCursor(3,0); // 4e plaats op 1e lijn
lcd.print("Laurien"); // Print tekst
}
void loop()
{
lcd.setCursor(6,1); // Zet cursor op plaats 7, 2e rij
lcd.print(teller); // Print getal
lcd.print(" "); // Print spatie (om O na 10 te wissen)
teller = teller +1; // Waarde van teller +1
delay(1000); // wacht 1 seconde
if(teller > 10) // Als waarde teller > 10
{ // Dan
teller = 0; // Zet teller op 0
}
}