#include #define RS 12 #define EN 11 #define D4 5 #define D5 4 #define D6 3 #define D7 2 #define PULSANTE 6 #define NFRASI 10 LiquidCrystal lcd(RS, EN, D4, D5, D6, D7); char frasi[NFRASI][16] = { "", "A<3", "B", "C", "D", "E", "F", "G", "H", "I", }; char visFrase = 0; char old_visFrase = 0; char old_button; void setup() { lcd.begin(16, 2); pinMode(PULSANTE, INPUT); } void loop() { char button = digitalRead(PULSANTE); if (button == LOW && old_button == HIGH) { visFrase++; if (visFrase > NFRASI - 1) visFrase = 0; } old_button = button; if (visFrase != old_visFrase) { lcd.clear(); lcd.setCursor(0, 0); lcd.print(frasi[visFrase]); old_visFrase = visFrase; } }