int button = 13;
int counter = 0;
int tombol_naik = 0;
int tombol_akhir = 0; // ketika counter sudah menunjukkan angka 9
void setup() {
// put your setup code here, to run once:
pinMode(button, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
tombol_naik = digitalRead(button);
if(tombol_naik != tombol_akhir){
if(tombol_naik == HIGH){
if(counter == 9){
counter = -1;
}
counter++;
Serial.println(counter);
}
}