How to Skip at a set number of button pushes

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
trisb
Flowcode V4 User
Posts: 40
Joined: Sat Mar 06, 2010 5:25 am
Location: Chicago USA, & Oxford & Northampton UK
Has thanked: 6 times
Contact:

How to Skip at a set number of button pushes

Post by trisb »

Hi Guys.

I have a Simply PWM signal that goes up and down in 10% steps at the press of a button.
How ever if the Up power button is pressed 10 times and the PWM is up to 100% it will revert back to 0%.

What do i need to do to get it to skip this part of my code if the button has been pushed 10 times...
I have tried many ways but have not been able to work it out.

Could some one help my out. copy of program attached.

Thanks Tristan.
Attachments
PWM test 1.fcf
(10.5 KiB) Downloaded 272 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How to Skip at a set number of button pushes

Post by Benj »

Hello Tristan,

I have added decisions into your macro to detect if the PWM is already at one or the other extreme. If the extreme is detected then the PWM signal will not be allowed to go beyond this.
Attachments
PWM test 1.fcf
(11 KiB) Downloaded 279 times

trisb
Flowcode V4 User
Posts: 40
Joined: Sat Mar 06, 2010 5:25 am
Location: Chicago USA, & Oxford & Northampton UK
Has thanked: 6 times
Contact:

Re: How to Skip at a set number of button pushes

Post by trisb »

Thanks Ben,,

That just what i was looking for.

Have a good weekend.

Tristan

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: How to Skip at a set number of button pushes

Post by Dan81 »

Hello Tristan

If you want to have 10% steps (exactly) , you must change the period register to 249.
Or you will not be able to get 100% (but only 98% as you can see in the simulation)

Daniel
Attachments
PWM test 2.fcf
(8.5 KiB) Downloaded 282 times

trisb
Flowcode V4 User
Posts: 40
Joined: Sat Mar 06, 2010 5:25 am
Location: Chicago USA, & Oxford & Northampton UK
Has thanked: 6 times
Contact:

Re: How to Skip at a set number of button pushes

Post by trisb »

Thanks Daniel.

Post Reply