short and long button press on the keypad

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone,
I have an excercise that conciste to program a 3x4 button keypad.
However, each button must have:
> Display the number of the button on the LCD
> Save a value of a defined position.
 
the first idea that I try to apply is: The implementation of a short and long button action.
For this I read the functions of Peter Dannegger that not seem the way to the case of a keypad.
the equipment I use is the suivatn:
Atmelstudio 7
April STK500
ATmega16 (L)
ISP
RS 232
3x4 Keypad

Is there anyone who can offer me an alternative idea, if someone can give me a code that made the action to the case of a keypad.

Last Edited: Sun. Oct 30, 2016 - 12:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Short/long press detection is simply the act of measuring the time between "make" and "release". When you first detect the button is activated take a note of your systick counter then check again when the button state changes again . 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for your intervention,
Please can you show me an example?
because the keypadbutton respond now only to one click (one action).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My input library here debounces and deals with button pressed and button held:

 

http://community.atmel.com/proje...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi again,
I read your article that is very interesting. but I'm stuck with the use of my keyscan() function that I`ve written.
can you tell me how should call my keyscan() with your illustrious library?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry Etie; I am swamped with work right now.  Hopefully someone else can chime in and make some suggestions for you.  My library only requires that you feed it inputs at a specific time period, such as every millisecond.  Good luck!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

a 3x4 keypad w/ LCD is such a common project, I would think a quick google search would find many examples:

Oh look, here is one:  http://extremeelectronics.co.in/...

 

good luck