So I am making a basic "security" system using a PIR sensor and a keypad to disarm and arm. It is also updating Xively with the sensor readings using a Ethernet 2 shield. it will update with no problems when I do not have my readKeypad()
code in it. As soon as I put in my code for the PIN entry it stops updating Xively giving me a can't connect error. Below is the basic code for keypad PIN entry, if I comment out the keypad.getkey()
it will update, but with it in it does not work.
So I have it narrowed down to keypad.getkey()
being the cause but I have no idea why. Anyone have this or a similar problem with Xively?
I have been trying different ways to read the keys and I tried to change getKey()
to something else. I tried getState()
, it will now update Xively but of course this doesn't return the key values I need. It would appear it does not like the getKey()
command
I have also tried with thingspeak and it has the same problem.
void readKeypad()
{
char entry = keypad.getKey();
Serial.print(entry);
if (entry != NO_KEY)
{
attempt[z]=entry;
z++;
switch(entry)
{
case '#':
z=0;
delay(100); // for extra debounce
checkPIN();
break;
}
}
}