button increase and decrease

For users of Matrix Multimedia Electronics software to discuss projects, circuits and any other electronics concepts.

Moderators: Benj, Mods

Post Reply
jbs4wd
Posts: 46
Joined: Thu Dec 03, 2009 7:29 am
Has thanked: 4 times
Contact:

button increase and decrease

Post by jbs4wd »

Could someone please get me started on this.
I need an up and down button which will increase or decrease a value which I want to compare another value with.
ie: value = 150
when up button pushed a value of 5 is added to (value) making it 155. same for the decrease.
I know what I want to do with this calculation but just seem to get it happening.

Cheers

JOHN

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: button increase and decrease

Post by medelec35 »

This should get you started.
You have not said whether your variable is byte or Integer, so assumed the former.
Not added switch debounce (which can simply be added), so flowchart is easier to understand.
Attachments
Button1.fcf
(6.5 KiB) Downloaded 390 times
Martin

jbs4wd
Posts: 46
Joined: Thu Dec 03, 2009 7:29 am
Has thanked: 4 times
Contact:

Re: button increase and decrease

Post by jbs4wd »

Thanks alot. That did help. I managed to nut it out a slightly different way, but yours will be used as well.

Cheers
JOHN

Post Reply