// https://forum.arduino.cc/t/cant-call-on-loops-using-serial-monitor/1055601
// https://wokwi.com/projects/348775516561474130
# define buttonPin 7
void setup() {
Serial.begin(115200);
Serial.println("Hello W0rld!");
pinMode(buttonPin, INPUT_PULLUP);
}
int sequence;
void loop() {
if (digitalRead(buttonPin) == LOW) {
delay(100);
if (digitalRead(buttonPin) == LOW) {
if (sequence == 8) {
sequence = 0;
}
sequence++;
Serial.println(sequence);
}
}
}