Hello!
I want to light the led when the password entered from the keyboard is the same as programm for leds ON and other password for led OFF. I use only the numpad.. so there is only numbers ... and I would like to make a delay after 3 incorect passwords entered...
something like :
passON=12345+; ( the + is the button '+' 0x79)
passOFF=12345enter ( the enter is the button 'Enter' 0xE0 0x5A ) if am right
if (passON== inpass)
digitalWrite(ledPin, HIGH);
if (passOFF== inpass)
digitalWrite(ledPin, LOW);
I'll use thes code ... I'm new in arduino, so i'll be happy if someone will help me...
#include <ps2.h>
PS2 kbd(3, 4);
void kbd_init()
{
char ack;
kbd.write(0xff); // send reset code
ack = kbd.read(); // byte, kbd does self test
ack = kbd.read(); // another ack when self test is done
}
void setup()
{
Serial.begin(9600);
kbd_init();
}
void loop()
{int m;
unsigned char code;
for (;;) { /* ever */
/* read a keycode */
code = kbd.read();
}
}