… and sorry for bothering you with another beginner question…
My actual project is very simple.
I use one of those starter sets from amazon to make this.
I have modified “Lesson 5 Digital Inputs”
The Setup looks like this “Schaltplan LED.PNG”
Since Interrupts work only at Port 2 and 3 I conected the switches there.
Most of the sketch is the same as the one in the lesseion (where everything works fine)
I do need to get in touch with interrupts, because I want to integrate something like an emergency-stop button. (for a later more complicated sketch)
So what I want this sketch to do is wait … until the first button is pressed.
This set x to 3 and the while loop makes the LED blink 3 times
In case of an “emergency” the sceond button is pressed and the value x should be set to 0 which ends the loop and everything is stopped.
Until the first button is pressed again setting x to 3… and so on
Not too complicated, but it doesn’t work the way I did it.
Any ideas, wherer is missed the important part ?
sketch_Button_Start-Stop_V2.ino (591 Bytes)