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
Switch to next pattern not working
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Switch to next pattern not working
Hi Frank,
The issue is you have a loop within RampDown macro:
.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
The issue is you have a loop within RampDown macro:
Code: Select all
LED_Brightness > RampDown.RampTo
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
Martin