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.
How to Skip at a set number of button pushes
Moderator: Benj
-
- 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
- Attachments
-
- PWM test 1.fcf
- (10.5 KiB) Downloaded 272 times
- 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
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.
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Thanks Ben,,
That just what i was looking for.
Have a good weekend.
Tristan
That just what i was looking for.
Have a good weekend.
Tristan
- Dan81
- 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
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
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