Please Let Me Know How Much You Like This (1 is very Bad - 10 is Excellent)

Controlling five LEDs with a button in a sequence with Arduino.



Using modulus operator we can turn on and off LEDs in sequence.


By using arrays we can shorten the code as seen below



al
29 Apr 2016

i'd like to do this with 1 button and only 3 led's what would the code look like for that ?

mekanizmalar
01 May 2016

In the second program change
int numberOfLED = 5;
to
int numberOfLED = 3;
and use first 3 LED.

Justin
20 Mar 2017

For the array I get the following errors, what's going on?

Button_Press-_Next_LED:1: error: expected unqualified-id before numeric constant
1: // www.mekanizmalar.com
^
Button_Press-_Next_LED:9: error: expected unqualified-i

mekanizmalar
29 Mar 2017

Cut and Paste operation takes the line numbers also. Please delete all the line numbers from Arduino program after pasting it.


Add a comment or brief description of this mechanism in your language.

LEGIT Comments will be displayed in 24 hours.

91 + 17 =


Leave this empty: