sensorHigh was not declared in this scope

int sensorValue;
int sensorLow=1023;
int sensorHigh = 0;

const int ledPin = 13;

void setup() {

pinMode(ledPin,OUTPUT);
digitalWrite(ledPin,HIGH);

Serial.begin(9600);

while(millis()< 5000){

sensorValue = analogRead(A0);
if(sensorValue > sensorHIGH){
sensorHIGH = sensorValue;
}

if(sensorValue < sensorLOW){
sensorLOW = sensorValue;
}
}
digitalWrite(ledPin,LOW);
}

void loop() {

sensorValue = analogRead(A0);

int pitch = map(sensorValue,sensorLOW,sensorHIGH,50,4000);
tone(8,pitch, 20);
Serial.print(“pitch:”);
Serial,println(pitch);
delay(10);

copied directly ?issue

You need to post the exact error message which will include the line number where the compiler found the problem

I see sensorHigh and sensorHIGH. They are not the same. C++ is case senstitive.

...R

sensorHigh != sensorHIGH

Wow! thanks! sensorLOW was also sensorLow. thanks for the help!!!