#define BUZZER_PIN 15
void setup() {
pinMode(BUZZER_PIN, OUTPUT);
}
void loop() {
// chơi thử vài nốt đơn giản
tone(BUZZER_PIN, 262); // Do
delay(300);
tone(BUZZER_PIN, 294); // Re
delay(300);
tone(BUZZER_PIN, 330); // Mi
delay(300);
tone(BUZZER_PIN, 349); // Fa
delay(300);
tone(BUZZER_PIN, 392); // Sol
delay(500);
noTone(BUZZER_PIN); // tắt âm
delay(2000);
}