Circuit 2

By Arjun1234
int noteDuration = 3;

int numNotes = 5;

int notes[] = {
  NOTE_CS6,
  NOTE_AS5,
};

void setup()
{
  Serial.begin(9600);
  pinMode(12, INPUT); 
}
;;;;;;;;;;;;;;;
int i = 0;
void loop()
{
  ;
  if (notes[i])
    tone(noteDuration, notes[i]);
  else
    noTone(noteDuration);
  delay(165);
  i = (i + 1) % numNotes;
}