int Hpulse = 13;
int Lpulse = A0;
int KeySet1 = 0;
int KeySet2 = 0;
void setup() {
// put your setup code here, to run once:
DDRB = B11100000; // 0 = input , 1 = output
PORTB = B00011111; // 1 = Pullup
DDRD = B11110000; // 0 = input , 1 = output
PORTD = B00001111; // 1 = Pullup
Serial.begin(9600);
pinMode(Hpulse, OUTPUT);
pinMode(Lpulse, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
PIND = B11101111;
delay(10);
KeySet1 = PINB;
delay(100);
PIND = B11011111;
delay(10);
KeySet2 = PINB;
Serial.print("KeySet1 = ");
Serial.print(KeySet1,BIN);
Serial.println("");
Serial.print("KeySet2 = ");
Serial.print(KeySet2,BIN);
Serial.println(" ");
delay(500);
}