#include "pitches.h"
#define SPEAKER_PIN 2
//const int buttonTones = NOTE_B0
const int buttonPin0 = 46;
const int buttonPin1 = 47;
const int buttonPin2 = 48;
const int buttonPin3 = 49;
const int buttonPin4 = 50;
const int buttonPin5 = 51;
const int buttonPin6 = 52;
const int buttonPin7 = 53;
//const int
const int ledPin0 = 13;
const int ledPin1 = 12;
const int ledPin2 = 11;
const int ledPin3 = 10;
const int ledPin4 = 9;
const int ledPin5 = 8;
const int ledPin6 = 7;
const int ledPin7 = 6;
int buttonState0 = 0;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(46, INPUT);
pinMode(47, INPUT);
pinMode(48, INPUT);
pinMode(49, INPUT);
pinMode(50, INPUT);
pinMode(51, INPUT);
pinMode(52, INPUT);
pinMode(53, INPUT);
pinMode(SPEAKER_PIN, OUTPUT);
}
void loop() {
buttonState0 = digitalRead(46);
if (buttonState0 == 1) { // If pushbutton is pressed, set as HIGH
digitalWrite(13, HIGH); // Turn on LED
delay(1000);
digitalWrite(13, LOW);
} else {
digitalWrite(13, LOW); // Otherwise, turn off LED
}
if (buttonState0 == 0) {
digitalWrite(13, LOW);
} else {
digitalWrite(13, HIGH);
}
if (buttonState0 == 1; buttonState0 != 0) {
tone(2, 262);
delay(1500);
} else {
noTone(2);
}
}