Hi, I'm trying to do something when I give it 5 volts to let the LED light up and the column to sound, but I have a code problem
int piezoPin = 8;
void setup() {
}
void loop() {
int VoltageLevel = analogRead(A0);
if (VoltageLevel >= triggerLevel){
digitalWrite(13, HIGH);
tone(piezoPin, 1000);
}
else {
digitalWrite (13, LOW);
tone(piezoPin, 0);
}
}
and gives me this error
error: 'triggerLevel' was not declared in this scope
if (VoltageLevel >= triggerLevel){
^
exit status 1
'triggerLevel' was not declared in this scope
please help