Switch to next pattern not working

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Frank607
Posts: 192
Joined: Mon Mar 04, 2013 8:07 pm
Has thanked: 29 times
Been thanked: 15 times
Contact:

Switch to next pattern not working

Post 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
Attachments
PAT and FADE.fcf
(39.45 KiB) Downloaded 638 times

medelec35
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

Post 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
Martin

Post Reply