const int SPEAKER = 3;
const int button_pin = 6;
bool previous_bt_state = false;
int notes[] = {
392, 392, 392, 311, 466, 392, 311, 466, 392,
587, 587, 587, 622, 466, 369, 311, 466, 392,
784, 392, 392, 784, 739, 698, 659, 622, 659,
415, 554, 523, 493, 466, 440, 466,
311, 369, 311, 466, 392
};
int times[] = {
350, 350, 350, 250, 100, 350, 250, 100, 700,
350, 350, 350, 250, 100, 350, 250, 100, 700,
350, 250, 100, 350, 250, 100, 100, 100, 450,
150, 350, 250, 100, 100, 100, 450,
150, 350, 250, 100, 750
};
void setup(){
pinMode(SPEAKER, OUTPUT);
pinMode(button_pin, INPUT_PULLUP);
Serial.begin(9600);
for (int i = 0; i < 39; i++){
tone(SPEAKER, notes[i], times[i]*2);
delay(times[i]*2);
noTone(SPEAKER);
}
}
void button_preseed(){
}
void loop(){
Serial.println(digitalRead(6));
}