int birta;
void setup() {
Serial.begin(9600);
pinMode(11, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(5, OUTPUT);
analogWrite(5, 80*2.55);
birta = 80;
Serial.print(birta);
Serial.println("%");
}
void loop() {
if(digitalRead(11) == LOW) {
if(birta >= 10) {
birta = birta - 10;
}
analogWrite(5, birta*2.55);
Serial.print(birta);
Serial.println("%");
delay(250);
}
if(digitalRead(10) == LOW) {
if(birta <= 95) {
birta = birta + 5;
}
analogWrite(5, birta*2.55);
Serial.print(birta);
Serial.println("%");
delay(250);
}
if(digitalRead(9) == LOW) {
birta = 100;
analogWrite(5, birta*2.55);
Serial.print(birta);
Serial.println("%");
delay(250);
}
}