#include <LiquidCrystal.h>
LiquidCrystal lcd = LiquidCrystal(13,12,7,6,5,4);
bool test = true;
bool test2 = true;
int cislo = 0;
String MENU[]= {"Play ","Load ","option ", "exit "};
void setup()
{
lcd.begin(16,2);
pinMode(A5, INPUT_PULLUP);
pinMode(A4, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(A5) == LOW && test == true)
{
test = false;
if(cislo < 3)
{
cislo++;
}
}
else if (digitalRead(A5) == HIGH && test == false)
{
test = true;
}
if (digitalRead(A4) == LOW && test2 == true)
{
test2 = false;
if(cislo > 0)
{
cislo--;
}
}
else if (digitalRead(A4) == HIGH && test2 == false)
{
test2 = true;
}
lcd.home();
lcd.print(MENU[cislo]);
lcd.print(" ");
}