int pinLed = A1;
int pinPot = A0;
int pinButt = 12;
void setup() {
Serial.begin(115200);
pinMode(pinPot, INPUT);
pinMode(pinButt, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
// arduino dokumentacija
// izpiši potenciometer vrednost
int value = analogRead(pinPot);
int bVal = digitalRead(pinButt);
if (bVal == 1){
analogWrite(pinLed, value);
}
else {
analogWrite(pinLed, 0);
}
// prižgi ledico z vrendostjo potenciometra, če je gumb prižgan
}