#include "pitches.h"               // notes in the melody:
const unsigned int BuzzerPin = 3;  
int melody[] = { NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5, NOTE_C6 };
int duration = 500;  // 500 miliseconds
void setup() {
  pinMode(BuzzerPin, OUTPUT);
}
void loop() {
  for (int thisNote = 0; thisNote < 8; thisNote++) {
    tone(BuzzerPin, melody[thisNote], duration);  // BuzzerPin output the voice, every scale is 0.5 sencond
    delay(300);                                   // Set the time delay, the larger the value, the smaller the sound frequency
  }
  delay(200);
}
