I'm very new to this forum, and after reading lots of different tutorials and try to find the solution to my problem myself I'd hope somebody
can help me.
Hi have a push button and a led light, but I want to serial monitor to do the following. Only report On/Off one time per change.
So lets say the led is off, than there should be in the serial monitor only 1 time Off, until the next change is taking place.
Zo it always you be somiting like
Off
On
Off
On
Off
On
I tried delay and other possibilities but with no success
The next project I want to make is also a pushbutton led, but also an extra led that will show how many times the button has been pressed, so 1 time blink once en than delay 5 sec. and if it was pressed than blink 2 times and delay 5 sec. but hope I can magage to do that myself
It sounds like you need to keep a record of the last state.
Then, each time through "loop()" see if the state you read from the button has changed.
If it has, print the new state, and store the new state.