The code is
int buttons[3];
buttons[0] = 2;
int notes [] = {262,294,330,349};
void setup() {
Serial.begin(9600);
}
void loop() {
int keyVal = analougRead(A0);
Serial.println(keyVal);
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 <= 15) {
tone(8, notes[3]);
}
else {
noTone(8);
}
}
and the error is
sketch_jul07a:2:1: error: 'buttons' does not name a type
buttons[0] = 2;
^~~~~~~
C:\Users\Armaan\OneDrive\Documents\Arduino\sketch_jul07a\sketch_jul07a.ino: In function 'void loop()':
sketch_jul07a:12:16: error: 'analougRead' was not declared in this scope
int keyVal = analougRead(A0);
^~~~~~~~~~~
C:\Users\Armaan\OneDrive\Documents\Arduino\sketch_jul07a\sketch_jul07a.ino:12:16: note: suggested alternative: 'analogRead'
int keyVal = analougRead(A0);
^~~~~~~~~~~
analogRead
exit status 1
'buttons' does not name a type