Hello
I am working on a menu structure for a LCD display where a couple of different values are set and stored in EEPROM.
I am tryibf to use one momentary + buuton to increase a value and a - button to decresae the value.
The idea is that the + button will increase with 1 if just presssed but if it is pressed for a longer time the value will start to count up with an increasing speed. The value that needs to be set will be somwhere between 10 and 4000 so a constant slow increasing speed would be of no use.
Does anyone has an example of how to do this? Or any hints or ideas how it could be done?
Accelerating momentary pushbutton
Moderator: Benj
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Accelerating momentary pushbutton
The speed of increase/decrease of the count can be set so it depends on the time the button has been held down. For example, if the "+" button is held it begins counting up by 1 for the first few seconds. If it remains held down, it counts up by 10 for the next few seconds, and so on. Releasing the button and then holding it down again will reset this rate of increase back to 1.