#include "pitches.h"
#define BOCINA 13
#define BOTON 0
void setup() {
pinMode(BOCINA, OUTPUT);
pinMode(BOTON, INPUT_PULLUP);
}
void loop() {
delay(1);
int tono = 0;
if (digitalRead(BOTON) == LOW) {
tono = NOTE_A7; // <-- Cambiado a NOTE_A7
}
if (tono) {
tone(BOCINA, tono);
} else {
noTone(BOCINA);
}
delay(10);
}