I have a problem with my program code i think.
My goals are to turn 1 led on if i press that button and if i press the same button again or the other button, then goes my led off and so one with the other led.
Now the problem is it doesn’t work anymore and also i’ve been trying to set my led on if i pressed my button for 3 seconds. The following components i use are: Arduino Uno rev3, 2x 220 ohm resistors, 3 red led’s, 2 buttons. Can you help me with this problem?
NOTE : I’m still just a beginner, however i have some specific things that i want
- I want to use a timer and NOT a delay
- Can you explain me each code that you wrote, in case if you found my problem?
- Also, there are code that i put in comment.
led_test.zip (1.26 KB)