int cislo;
bool test = true;
bool test1 = true;
bool test2 = true;
void setup() {
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
pinMode(A2, INPUT_PULLUP);
Serial.begin(9600);
}
void loop()
{
if(digitalRead(A0) == 0 && test == true)
{
test = false;
cislo++;
Serial.println(cislo);
}
else if(digitalRead(A0) != 0 && test != true)
{
test = true;
}
if(digitalRead(A1) == 0 && test1 == true)
{
test1 = false;
cislo = cislo + 5;
Serial.println(cislo);
}
else if(digitalRead(A1) != 0 && test1 != true)
{
test1 = true;
}
if(digitalRead(A2) == 0 && test2 == true)
{
test2 = false;
cislo = cislo + 10;
Serial.println(cislo);
}
else if(digitalRead(A2) != 0 && test2 != true)
{
test2 = true;
}
}