In the below Program "Release" and "Idle" are not working...
i have connected all rows and columns correctly...
ANY HELP???????????????????????????
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the kpd
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the kpd
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
}
void loop(){
// Fills kpd.key[] array with up-to 10 active keys.
// Returns true if there are ANY active keys.
if (kpd.getKeys())
{
for (int i=0; i<LIST_MAX; i++) // Scan the entire list.
{
if (kpd.key*.kchar != NO_KEY) // Test for an active key.*
- {*
_ switch (kpd.key*.kstate) { // Test for key state IDLE, PRESSED, HOLD, or RELEASED*_
* case HOLD:*
* Serial.print("Key ");*
_ Serial.print(kpd.key*.kchar);
Serial.print(" is being HELD and the state ");
if (!kpd.key.stateChanged)
Serial.println("has not changed.");
else*
* Serial.println("has changed.");
break;
case PRESSED:
Serial.print("Key ");
Serial.print(kpd.key.kchar);
Serial.print(" is PRESSED and the state ");
if (!kpd.key.stateChanged)
Serial.println("has not changed.");
else*
* Serial.println("has changed.");
break;
case RELEASED:
Serial.print("Key ");
Serial.print(kpd.key.kchar);
Serial.print(" has been RELEASED and the state ");
if (!kpd.key.stateChanged)
Serial.println("has not changed.");
else*
* Serial.println("has changed.");
break;
default:
Serial.print("Key ");
Serial.print(kpd.key.kchar);
Serial.print(" is IDLE and the state ");
if (!kpd.key.stateChanged)
Serial.println("has not changed.");
else*
* Serial.println("has changed.");
}
}
}
}
} // End loop*_