void setup() {
Serial.begin(115200);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
}
void loop() {
int pot = analogRead(A0);
pot = map(pot, 0, 1023, 1, 10);
Serial.println(pot);
if (pot <= 3) digitalWrite(3, HIGH);
if (pot > 3 && pot <= 6) digitalWrite(2, HIGH);
if (pot > 6) digitalWrite(4, HIGH);
delay(200);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
/*switch(pot) {
case 1:{
Serial.println("zelena");
break;
}
case 2:{
Serial.println("Rdeča");
break;
}
case 3:{
Serial.println("Rumena");
}
}
*/
}