const int buzzerPin = 8;
int notas[] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440}; // vetor com frequencia das notas musicais: dó, ré...
void setup() {
// put your setup code here, to run once:
pinMode(buzzerPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i < 10; i++) {
tone(buzzerPin, notas[i]);
delay(500);
}
noTone(buzzerPin);
// tone(buzzerPin, 1200, 500);
// delay(1000);
// essas 3 linhas ou acima
// delay(500);
// noTone(buzzerPin);
// delay(500); //aguarda 500 desligado
}