# Trouble with flashing leds in sequence

**URL:** <https://forum.xod.io/t/trouble-with-flashing-leds-in-sequence/564>\
**Category:** Uncategorized\
**Created:** [March 11, 2018, 5:44pm UTC](https://forum.xod.io/t/trouble-with-flashing-leds-in-sequence/564 "2018-03-11T17:44:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyletetkoski](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kyletetkoski](https://forum.xod.io/u/kyletetkoski)\
**Post date:** [March 11, 2018, 5:44pm UTC](https://forum.xod.io/t/trouble-with-flashing-leds-in-sequence/564/1 "2018-03-11T17:44:14Z")

</div>

I’m new to Arduino and I’m trying to just get a good handle on coding and xod. I just want to do a simple project making 5 leds flash in sequence over and over again. I’m using led nodes, flip-n-times, pulse on false, delays, then a defer to start it over. All I get out of it is all of the leds flashing randomly. I want the first one to be on for 1 second and off for one second. Then the second, etc. should I be using state nodes instead? Maybe I’m making it too complicated. Any help would be great. Thanks!

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 11, 2018, 11:11pm UTC](https://forum.xod.io/t/trouble-with-flashing-leds-in-sequence/564/2 "2018-03-11T23:11:27Z")

</div>

Have you read through [https://xod.io/docs/guide/simple-traffic-light/](https://xod.io/docs/guide/simple-traffic-light/)? You should be able to start with that & add extra delays between the nodes so you have have 1 second with no lights on.

---

<div class="post-metadata">

**Author:** ![kyletetkoski](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kyletetkoski](https://forum.xod.io/u/kyletetkoski)\
**Post date:** [March 12, 2018, 1:01am UTC](https://forum.xod.io/t/trouble-with-flashing-leds-in-sequence/564/3 "2018-03-12T01:01:42Z")

</div>

That helped out a lot. It would be nice if they made some sort of sequence node where you could just assign outputs to pins and create any order you want. Thanks!

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [March 12, 2018, 2:03pm UTC](https://forum.xod.io/t/trouble-with-flashing-leds-in-sequence/564/4 "2018-03-12T14:03:52Z")

</div>

It would be pretty easy to create your own with variadic pins available in the latest version of XOD ([https://xod.io/docs/guide/variadics/](https://xod.io/docs/guide/variadics/)). It would be difficult to create a generic one since there are so many variations. Do you hard-code the blink time? Specify a single blink time? Specify time on & time off? Specify once or for each light? If using this for a traffic light with sensors, you would want a way to stay on the green light until a sensor is triggered (File -\> Add Library -\> “gweimer/traffic-light-advanced” for a more advanced traffic light tutorial).
