I just can't seem to use it. I have my keypad rigged up, and displaying it onto a LCD screen. However I can't figure out how to use the hold function. I want to jog some motors and stuff when a key is held, and stop when it's released, but for some reason the keypad never registers a "HOLD" state. or I am using it wrong, here is my current attempt. the 0xDD plays a beeping sound. Ihad a while statement instead of IF, and once it started beeping it would never stop! not sure if that was a function of the keypad or the LCD, so I went IF, since I figured just keep guessing till I get it right. with this code I do see the "in switch" line, but never get inside the if statment
char key = kpd.getKey();
if(key) // Check for a valid key.
Serial1.write(key);
{
switch (key)
{
case '*':
Serial1.print("in switch");
if (kpd.getState()==HOLD){
Serial1.print("in if");
delay(500);
Serial1.write(0xDD);
Serial1.print("hold");
}
break;
I could use some guidance, I don't want to have to use a ON key and OFF key