[SOLVED] Push button

Papabravo

Joined Feb 24, 2006
21,227
In general pushbuttons and keys on a keyboard are loosely related. A good typist can sustainably type 120 words per minute, which is a new key (button) every 100 milliseconds. A knowledge of bounce times for both make and break has implications for being able to reliably catch every key without a miss. It is a classic sampled data system where the sampling frequency and the number of samples to detect both a make and a release are critical. Some keys are also "repeat keys" which count as an additional make contact without a release. Cursor keys are a good example of this. It does take a bit of time and effort to successfully debug a set of robust keyboard algorithms.
 

atferrari

Joined Jan 6, 2004
4,771
I got used to consider upfront what kind of keys/buttons I will be using in a design:

1 - those that once serviced should be released (and pressed down again) to repeat the corresponding desired action.

2 - those that as long as they are kept pressed down will result in a specific lasting effect.

3 - those that when pressed down will produce a different action depending if another key (which I learnt to call "qualifier") is also pressed down or not. The "Shift" key is a good example.

After learning to program the Z80, by reading the Timex 2068 technical manual (yes, I even bought it!) I managed to understand how to handle a keyboard. I was fascinated with the clever use of I/O pins. Once with PICs I wrote my own routines for 4x4 keyboards and 8x1 button pads debounced with non blocking counters.
 

Papabravo

Joined Feb 24, 2006
21,227
I got used to consider upfront what kind of keys/buttons I will be using in a design:

1 - those that once serviced should be released (and pressed down again) to repeat the corresponding desired action.

2 - those that as long as they are kept pressed down will result in a specific lasting effect.

3 - those that when pressed down will produce a different action depending if another key (which I learnt to call "qualifier") is also pressed down or not. The "Shift" key is a good example.

After learning to program the Z80, by reading the Timex 2068 technical manual (yes, I even bought it!) I managed to understand how to handle a keyboard. I was fascinated with the clever use of I/O pins. Once with PICs I wrote my own routines for 4x4 keyboards and 8x1 button pads debounced with non blocking counters.
There is no end to the things you can learn by reading OPC (Other People's Code)
 

Young2

Joined Dec 7, 2020
93
Perhaps you need to provide more detailed information, such as what MCU are you using and what LCD are you using? Some touch LCDs can be directly designed with GUI, and what effects the buttons achieve is up to the MCU. Whether the button is pressed and lifted or long pressed this is also something that needs to be provided in detail.
 
Top