void setup() { Serial.begin(9600); pinMode(13, OUTPUT); pinMode(12, OUTPUT); pinMode(11, OUTPUT); pinMode(10, OUTPUT); pinMode(7, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); pinMode(5, INPUT_PULLUP); pinMode(4, INPUT_PULLUP); } void loop() { digitalWrite(13, 0); digitalWrite(12, 1); digitalWrite(11, 1); digitalWrite(10, 1); if (digitalRead(7) == 0){Serial.println("1"); while(digitalRead(7) == 0){}} if (digitalRead(6) == 0){Serial.println("2"); while(digitalRead(6) == 0){}} if (digitalRead(5) == 0){Serial.println("3"); while(digitalRead(5) == 0){}} if (digitalRead(4) == 0){Serial.println("A"); while(digitalRead(4) == 0){}} digitalWrite(13, 1); digitalWrite(12, 0); digitalWrite(11, 1); digitalWrite(10, 1); if (digitalRead(7) == 0){Serial.println("4"); while(digitalRead(7) == 0){}} if (digitalRead(6) == 0){Serial.println("5"); while(digitalRead(6) == 0){}} if (digitalRead(5) == 0){Serial.println("6"); while(digitalRead(5) == 0){}} if (digitalRead(4) == 0){Serial.println("B"); while(digitalRead(4) == 0){}} digitalWrite(13, 1); digitalWrite(12, 1); digitalWrite(11, 0); digitalWrite(10, 1); if (digitalRead(7) == 0){Serial.println("7"); while(digitalRead(7) == 0){}} if (digitalRead(6) == 0){Serial.println("8"); while(digitalRead(6) == 0){}} if (digitalRead(5) == 0){Serial.println("9"); while(digitalRead(5) == 0){}} if (digitalRead(4) == 0){Serial.println("C"); while(digitalRead(4) == 0){}} digitalWrite(13, 1); digitalWrite(12, 1); digitalWrite(11, 1); digitalWrite(10, 0); if (digitalRead(7) == 0){Serial.println("*"); while(digitalRead(7) == 0){}} if (digitalRead(6) == 0){Serial.println("0"); while(digitalRead(6) == 0){}} if (digitalRead(5) == 0){Serial.println("#"); while(digitalRead(5) == 0){}} if (digitalRead(4) == 0){Serial.println("D"); while(digitalRead(4) == 0){}} }