Page 1 of 1

Switch to next pattern not working

Posted: Tue Mar 15, 2016 7:23 pm
by Frank607
Hi,

I have made a program for flashing LEDs. In this program is also a fade in / fade out pattern.

If I push the button then starts pattern 1. The next push on the button will start pattern 2 with the fade in / fade out pattern. This all works good.

But when I’m in pattern 2 and push the button to go to pattern 3 it will not go to pattern 3.

Attached is the Flowcode program. Hopefully someone can help me.

Kind regards,

Frank

Re: Switch to next pattern not working

Posted: Tue Mar 15, 2016 8:46 pm
by medelec35
Hi Frank,
The issue is you have a loop within RampDown macro:

Code: Select all

LED_Brightness > RampDown.RampTo
.RampTo is a local variable and since not set will be = 0
Because LED_Brightness will always be greater then RampDown macro will never be exited (same for RampUp macro).
Therefore LED pattern will always be due to timer interrupt.

Hope that helps

Martin