# Blinking Sequence not really working

**URL:** <https://forum.xod.io/t/blinking-sequence-not-really-working/1359>\
**Category:** Uncategorized\
**Created:** [November 14, 2018, 9:40am UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359 "2018-11-14T09:40:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![marty](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@marty](https://forum.xod.io/u/marty)\
**Post date:** [November 14, 2018, 9:40am UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/1 "2018-11-14T09:40:51Z")

</div>

Hi  
I am pretty new to XOD but I love it more or less already - I am not the big “coder” - therefore very good for me 😉  
Working on a project and needed a blinking sequence of a single LED.  
Found on Youtube a video where someone was creating a morse code signal - voila - exactly what I need !  
Rebuild it and not working:  
My problem is that some sequenced flashes of the LED are bright (OK) - some are dimmed (not OK)  
tried everything - shortened, longed the flashes - swaped the long and short ones in order - no success.  
Am I doinng something wrong or is it a bug ??? In the Video it works great.

Made it with “Flip-N-Times” nodes (being on Active False), fed this ACT via “pulse-on-false” and a delay to the next stage, sequnce of “Flip-N-Times”  
Routed the end DONE via a “defer” and an “ANY” to the first stage to create a loop.

Mainly the sequence works ok - but like described - some flashes are dimmer, sometimes it looks the LED stays on and dimms down for certain flashes - I give up 😉

Anyone some help ?

Cheers  
Marty

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 14, 2018, 1:09pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/2 "2018-11-14T13:09:08Z")

</div>

Hi, can you upload the xodball and the video address you refer to?

---

<div class="post-metadata">

**Author:** ![marty](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@marty](https://forum.xod.io/u/marty)\
**Post date:** [November 14, 2018, 2:33pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/3 "2018-11-14T14:33:01Z")

</div>

Xodball ??? you mean the file ? sorry dont have it anymore - started building it exactly like in the vid.  
and then thousand changes - no luck 😉

the video on youtube is called: XOD Tutorial 1\_ Getting Started

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 14, 2018, 5:39pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/4 "2018-11-14T17:39:40Z")

</div>

XOD has changed a lot since the publication of that video, what would you like to do? I see how I can help you 🙂

[blink-multi.xodball](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/f0b216be8833fb0376c2dbb3045aa73acb69e8b3.xodball) (7.6 KB)

---

<div class="post-metadata">

**Author:** ![marty](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@marty](https://forum.xod.io/u/marty)\
**Post date:** [November 14, 2018, 10:04pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/5 "2018-11-14T22:04:33Z")

</div>

thanks a lot - Oh I see therefore the “old” tutorial is noch working 😉  
your file workes good - thanks a lot - I changed a few values and made it to my need - although its tricky with the delays

One big question: I made a longer loop out of more sequences of yours with two different LEDs. There is still, that a few of these “branches” of the loop is dimmer, other ones are full brightness - does this has to do with non exact delay values that there is a bit of overlap etc ?

Its not important - I am happy as it is right now - would be just curios to know.  
For me as a “non coder” - XOD is the perfect thing - never got so much into arduino ever - like it.  
Next project is connecting the whole thing to bluetooth - are you experienced in that topic too ?

Thanks a lot  
cheers  
Marty

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 14, 2018, 10:39pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/6 "2018-11-14T22:39:52Z")

</div>

> [@marty](#):
>
> One big question: I made a longer loop out of more sequences of yours with two different LEDs. There is still, that a few of these “branches” of the loop is dimmer, other ones are full brightness - does this has to do with non exact delay values that there is a bit of overlap etc ?

upload the xodball file to verify it.

---

<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:** [November 15, 2018, 1:17am UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/7 "2018-11-15T01:17:14Z")

</div>

My 1st guess would be that you have multiple LED nodes with the same port and somehow your code is trying to activate more than one of these at a time, so the LUM value for the port is bouncing between on & off, causing LED to not be full bright.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 15, 2018, 1:33am UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/8 "2018-11-15T01:33:48Z")

</div>

> [@marty](#):
>
> One big question: I made a longer loop out of more sequences of yours with two different LEDs. There is still, that a few of these “branches” of the loop is dimmer, other ones are full brightness - does this has to do with non exact delay values that there is a bit of overlap etc ?

I upload a new more configurable example  
[blink-multi-3.xodball](https://forum.xod.io/uploads/xod/original/1X/7b60cf58bdae7c2b8213aa51509f06c389eb4b6c.xodball) (28.3 KB)

**update** , comments and an identical patch without buses were added  
thanks you @gweimer

---

<div class="post-metadata">

**Author:** ![marty](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@marty](https://forum.xod.io/u/marty)\
**Post date:** [November 15, 2018, 9:57am UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/9 "2018-11-15T09:57:34Z")

</div>

@ gweimer: yes I guess so too - too many delays steppen on echt other toes 😉  
@ cesars: wow the new Blink looks complicated - Ill give it a try

tried to attache my novice version for the multiblink with 2 LEDs - but it says as a new user I cant upload anything

but nevertheless, thanks for your help

---

<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:** [November 15, 2018, 2:38pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/10 "2018-11-15T14:38:55Z")

</div>

> [@cesars](#):
>
> I upload a new more configurable example

Cool code, but you might want to add come comments for beginners. Is there a reason you used bus to feed if-else-v instead of moving it below the defer nodes?

As a quick overview:

- the “clock” node at the top allows you to set how long between blinks (each “tick” starts a new blink). The “delay” node feeding into it specifies how long after boot before blinking starts (5 seconds)
- the nodes feeding “led” node cause LED to be on for 1st half of each “tick”. You could change the divide value so on-time is more or less than 1/2 of each tick. You could even add another “if-else-v” to change the on-time during the pattern.
- the “between” and “greater” nodes feed “if-else-v” to determine how long each “tick” is. (The 1st 5 “ticks” are 0.5 seconds; next 5 are 1s; last 5 are 2s). You can expand if-else-v and add more conditionals to make more complex patterns.
- the “count” node counts how many blinks we have done. The “equal” node feeding into it resets count after 15. (Since count is a number, which could be fractional, it would be safer to use greater 15 instead of equal 16; this is not as critical since we are just adding 1 and not doing multiply or divide)

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 15, 2018, 3:18pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/11 "2018-11-15T15:18:49Z")

</div>

> [@gweimer](#):
>
> Cool code, but you might want to add come comments for beginners. Is there a reason you used bus to feed if-else-v instead of moving it below the defer nodes?

hi, none, just that as the defer goes up I leave it there

> [@gweimer](#):
>
> the “clock” node at the top allows you to set how long between blinks (each “tick” starts a new blink). The “delay” node feeding into it specifies how long after boot before blinking starts (5 seconds)

As it is an example I thought it was good to add more nodes, it could be 1 second or descactivate it  
Without the delay, the first ones are almost not seen if the console is used

> [@gweimer](#):
>
> - the nodes feeding “led” node cause LED to be on for 1st half of each “tick”. You could change the divide value so on-time is more or less than 1/2 of each tick. You could even add another “if-else-v” to change the on-time during the pattern.
> - the “between” and “greater” nodes feed “if-else-v” to determine how long each “tick” is. (The 1st 5 “ticks” are 0.5 seconds; next 5 are 1s; last 5 are 2s). You can expand if-else-v and add more conditionals to make more complex patterns.
> - the “count” node counts how many blinks we have done. The “equal” node feeding into it resets count after 15. (Since count is a number, which could be fractional, it would be safer to use greater 15 instead of equal 16; this is not as critical since we are just adding 1 and not doing multiply or divide)

👍 the teacher is you 👏

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [November 15, 2018, 4:47pm UTC](https://forum.xod.io/t/blinking-sequence-not-really-working/1359/12 "2018-11-15T16:47:04Z")

</div>

Update with comments and add a patch without buses.

When doing the buses using counter output, there are no names, if there are several meters, the `number` buses are mixed and you have to put them manually.
