hi all,
I am aware this has been asked to death but still, i have not been able to find a satisfactory answer to my problem.
I have a simple push button that needs to write a message every time it goes high. It is low by default.
Now, my mockup code looks like this:
void loop() {
if (digitalRead(pushPin) == LOW) {
// write everything is OK
Serial.print(“OK”)
} else {
Serial.print(“OPEN”)
}
}
The problem is, i need just ONE TIME write of "OPEN" message once the pus button pin goes high. Right now it would keep writing the message as long as the pin is HIGH.
Ideally, once the push pin goes high, i would get a message "open" once, then to get it again the push pin would have to go back to LOW and then back to HIGH again.
Many thanks in adavance,
Alek