void setup() {
// put your setup code here, to run once:
// name Arduino board pins used by the circuit
const int notePin = A0;
const int togglePin = 3;
const int buzzerPin = 8;
void loop() {
// put your main code here, to run repeatedly:
// declare variables
int rate = 500;
int frequency= 1000000 / (rate * 2);
// name Arduino board pins used by the circuit
const int notePin = A0;
const int togglePin = 3;
const int buzzerPin = 8;
// declare variables
int keyVal = 0;
ladder
// declare variables
int rate = 500;
int frequency=1000000 / (rate * 2);
// name Arduino board pins used by the circuit
const int notePin = A0;
const int togglePin = 3;
const int buzzerPin = 8;
// declare variables
int keyVal = 0;
ladder
// declare variables
int keyVal = 0;
ladder
int key = 0;
// declare variables
int keyVal = 0;
ladder
int key = 0;
int switchState = 0:
// declare variables
int keyVal= 0;
ladder
int key = 0;
int switchState = 0;
int note = 0;
int oldNote = 0;
// stores the analog value from the resistor
// stores the button that is pressed
// stores the state of the toggle button
// stores which note should be played
// stores the previous note that was played
// declare variables
int keyVal = 0;
ladder
int key = 0;
int switchState = 0;
int note = 0;
int oldNote = 0;
// an array of notes with frequencies of middle C, D, E, F, G, A, B, and high C
int notes[]={262, 294, 330, 349, 392, 440, 494, 523};
// stores the analog value from the resistor
// stores the analog value from the resistor
}