Hello - I have a code help request. I have code that is counting how many times a button has been pushed - which I got from here.
It's going ok and I'm so happy to find all these great tutorials - but because basically it is using modulo and turning on an LED when the result is 0 - it means that the LED is on when the program starts. Any ideas on how to start with the LED off and then have to press the button 4 times to turn it on?
Thanks, Rachel
code snippet:
if (buttonPushCounter % 4 == 0) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}