Pages: [1]   Go Down
Author Topic: 2 pushbuttons and menu select  (Read 631 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

for a project i must have 2 push buttons and from this i must execute the following

menu 1         zone1
                        zone2
                       zone3

menu 2         duration 1
                        duration 2

menu3        time 1
                      time 2
                      time 3

menu 4      you have chosen zone 3,duration 2. time 3


when you hit first button it should toggle through each menu, when you push button 2 it should change incremenent time,duration and zone according to the menu selection. need help with the code!!!
Logged

DE
Offline Offline
God Member
*****
Karma: 21
Posts: 707
| Germany | NRW |
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

WHERE should the menu be displayed on / at ?
Logged

Dum spiro, spero - if you find my posting helpful, please click my Karma smiley
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do you know A.R.T

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

should be displayed under the serial monitor
but i cant seem to figure it out
Logged

Poland
Offline Offline
Full Member
***
Karma: 7
Posts: 180
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would try using one button to move across menus, second button to move across options and long press of the second button as an "enter" button while long press of the First button could act as an "escape".  You have to count How many times button was pressed and use switch case. Then in each case you will have switch cases for options. For debouncing buttons and detecting long pressed you can use one of the button libraries. I'll try to write some code when i get back home but you can search for switch case menu egzamples.
Logged

DE
Offline Offline
God Member
*****
Karma: 21
Posts: 707
| Germany | NRW |
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

as Pane waski  smiley-wink already wrote: you have only 2 choices with 2 buttons):
that one that waski wrote or, instead, you can press both buttons for "enter" - but a little bit tricky with timing  smiley-mr-green
Logged

Dum spiro, spero - if you find my posting helpful, please click my Karma smiley
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do you know A.R.T

Pages: [1]   Go Up
Jump to: