thanosxx's code from the attachment in the first post, auto formatted and in code tags:
int buttons[6];
int buttons[0] = 2;
int notes[] = {262, 294, 330, 349};
void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
}
void loop() {
int keyVal = analogRead(A0);
Serial.println(keyVal);
// put your main code here, to run repeatedly:
if (keyVal == 1023) {
tone(8, notes[0]);
}
else if (keyVal >= 990 && keyVal <= 1010) {
tone(8, notes[1]);
}
else if (keyVal >= 505 && keyVal <= 515) {
tone(8, notes[2]);
}
else if (keyVal >= 5 && keyVal <= 10) {
tone(8, notes[3]);
}
else {
no tone(8);
}
}
}
}