LED1 goes on for 500 ms then goes Off
Then LED2 goes ON for 500 ms then goes OFF
Then LED1 goes ON for 500 ms then goes OFF
Then LED2 goes ON for 500 ms then goes OFF
Then LED3 goes ON for 500 ms then goes OFF
Then LED4 goes ON for 500 ms then goes OFF
Then LED3 goes ON for 500 ms then goes OFF
Then LED4 goes ON for 500 ms then goes OFF
NoProblem:
Getting little confused and Need some assistance
I want to write a code that will make 4 LEDs go in a specific sequence
Eg Sequence
LED1 goes on for 500 ms then goes Off
Then LED2 goes ON for 500 ms then goes OFF
Then LED1 goes ON for 500 ms then goes OFF
Then LED2 goes ON for 500 ms then goes OFF
Then LED3 goes ON for 500 ms then goes OFF
Then LED4 goes ON for 500 ms then goes OFF
Then LED3 goes ON for 500 ms then goes OFF
Then LED4 goes ON for 500 ms then goes OFF
Then is starts over again
I believe that you need to write a function which takes two parameters: the LED to turn on and, optionally, the time to remain on. So, your loop would read as:
Please can you expand of your code a little further, still lost
I know i could use
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
but this seem very difficult to time the LED lights
please can someone assist further although i have used a LED as an example its really is to turn of some octocouplers were timing is important