const int BTN_PINS[] = {12, 11, 10};
const int LED_PINS[] = {6, 5, 3};
const int BUZZ_PIN = 2;
void setup() {
Serial.begin(115200);
for (int count = 0; count < 3; count++) {
pinMode(BTN_PINS[count], INPUT_PULLUP);
pinMode(LED_PINS[count], OUTPUT);
}
//pinMode(BUZZ_PIN, OUTPUT);
Serial.println("Ready");
}
void loop() {
if (BTN_PINS[0] == LOW) {
Serial.println("Here");
tone(BUZZ_PIN, 220);
digitalWrite(LED_PINS[0], HIGH);
} else if (BTN_PINS[1] == LOW) {
tone(BUZZ_PIN, 440);
} else if (BTN_PINS[2] == LOW) {
tone(BUZZ_PIN, 880);
} else {
noTone(BUZZ_PIN);
}
}