Hi all,
Im working on my rewrite of my aquarium controller, Im currently working on the menu and want to use one button for entering and exiting from the menu.
I want to do this by using a short press to go to the next item of the menu and a longer press (2sec) to exit the menu.
I dont know how to go around this, maybe you can help.
Regards Jordy
Button... Controll Menu Question
Moderator: Benj
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Button... Controll Menu Question
Hi Jordy,
There are a few ways of doing this.
Attached is what I believe is the simplest way using one button.
There may be other ways of course.
I could create a flowchart using several buttons, but will be more complex
Flowchart will also eliminate issues caused by contact bounce.
Martin
There are a few ways of doing this.
Attached is what I believe is the simplest way using one button.
There may be other ways of course.
I could create a flowchart using several buttons, but will be more complex
Flowchart will also eliminate issues caused by contact bounce.
Martin
- Attachments
-
- Button Control1.fcf
- (15 KiB) Downloaded 457 times
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Button... Controll Menu Question
I have added 2 more switches.
So now you can short press or long press any combination simultaneously.
I have mapped switches with keys 0 to 2.
so
Key 0 will control switch connected to A0
Key 1 will control switch connected to A1
and Key 2 will control switch connected to A2
You can also have a combination as stated earlier.
E.g press keys 0 and 1 and keep held for a second for long press A0 & A1
or press keys 1 and 2 and release key 2 for short press A1 and long press A2 etc.
So now you can have 24 menus from just 3 switches (if I have worked it out correctly, prob not
)
So now you can short press or long press any combination simultaneously.
I have mapped switches with keys 0 to 2.
so
Key 0 will control switch connected to A0
Key 1 will control switch connected to A1
and Key 2 will control switch connected to A2
You can also have a combination as stated earlier.
E.g press keys 0 and 1 and keep held for a second for long press A0 & A1
or press keys 1 and 2 and release key 2 for short press A1 and long press A2 etc.
So now you can have 24 menus from just 3 switches (if I have worked it out correctly, prob not

- Attachments
-
- Button Control2.fcf
- (24.39 KiB) Downloaded 442 times
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Button... Controll Menu Question
This version works much better on hardware with more than one switch pressed simultaneously.
- Attachments
-
- Button Control3.fcf
- (24.59 KiB) Downloaded 464 times
Martin
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: Button... Controll Menu Question
Thanks Martin you are a genius.
It helped me a lot.
Thanks
It helped me a lot.
Thanks
the will to learn, should not be stopped by any price
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times