hi all, i need help.
i wanna code for a project, when push the botton the led will start running, and willbe stop when i push the button again.
but my result code is the led start running first and cant stop when i pust the botton
here my code, thanks for helping
const byte LED1 = 10; // Pin for LED 1
const byte LED2 = 11; // Pin for LED 2
const byte LED3 = 12; // Pin for LED 3
const byte SW = 8; // Pin for the switch
Have you done any code for this yet?
Maybe you have already done the running LED code and now you want to know how to start / stop the running LEDs with a button press.
If you haven't done the running LEDs yet, there's a tutorial here
When you have the running LEDs working, you can ask how to add the code for the button to turn the running off and on
What exactly is a "Running LED"? Possibly you mean a LED chaser where the LEDs sequentially turn On/Off in a chasing effect? Should you want a LED Chaser a simple Google of LED Chaser Arduino will get you plenty of examples and code.
Next have you read the forum guidelines? The way this works is you make your code and post it appropriately using code tags. Then explain where you want help with your code. Next, when I see a post like yours using all upper case letters I generally just ignore it. Again, read the forum guidelines.
for the led and push botton, i dont know too, my teacher ask me to make a running led on off with push botton. and i see the example for 1 led they make like this skema. so i follow them for 3 leds