Pages: [1]   Go Down
Author Topic: i2c keypad and setHoldTime  (Read 677 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how can i insert Hold Time on i2c keypad it isn't included in i2c keypad library can i use it ?
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 114
Posts: 4226
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please post your code so that we can see what you have done so far.
A link to the library you are using would also help.

Can you please explain what you want to do in the context of your code ?
It sounds like you want to set the time a key must be held before it is recognised but without a fuller explanation it is impossible to know.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is my code
Code:

* TELIKOS_SYNAGEMOS.pde (11.04 KB - downloaded 15 times.)
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 114
Posts: 4226
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Assuming that by setHoldTime is used to set the time that a key is held before it is recognised then the library does not seem to have such a method.  You could consider modifying the library to include such a method (or a fixed time) but can you please confirm the meaning of setHoldTime and why it is important to you ?
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

because when i press a button i take 3 times this button for example when i press the 3 i take 33333
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 114
Posts: 4226
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you press the button (key) 3 times I would expect to only get 3 values.

Does the get_key method return a value :
(a) When a key is pressed
or
(b) when a key is released
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 73
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When a key is pressed
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 114
Posts: 4226
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When a key is pressed
Have you tried applying debouncing code to the reply from get_key ?
Read the keypad.  Start a timer.  When the timer finishes read it again.  If it is the same accept the key, if not, do it again until the 2 readings match.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Phillipsburg, NJ
Offline Offline
Full Member
***
Karma: 6
Posts: 184
Author: Matrix Keypad Library
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how can i insert Hold Time on i2c keypad it isn't included in i2c keypad library can i use it ?
If you are using G.D. Young's Keypad_I2C https://github.com/joeyoung/arduino_keypads/tree/master/Keypad_I2C library then the answer is yes.  His library inherits from the keypad library which provides a public function for setting the hold time.
Code:
setHoldTime(unsigned int time)
http://playground.arduino.cc/Code/Keypad#Functions

But his library requires that you are using an I2C port expander.  So if you are not using that, and/or you are using one of the other I2C keypads then this info will mean nothing to you.
Logged

Pages: [1]   Go Up
Jump to: