Theremin not reacting to photoresistor

Hello!

I am trying to control the sound of a Theremin with a photoresistor (Project 06 in the Arduino project book.)

The problem is: The Theremin does not change it sound at all, so i must have done a mistake in the code.

I appreciate if someone could give me any advice :slight_smile:

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

const int ledPin = 13;

 void setup() {
//Turn on LED pin to indicate calibration has started
pinMode (ledPin,OUTPUT); 
digitalWrite (ledPin, HIGH);

while (millis() < 5000) {

//Set sensor high
  sensorValue = analogRead(A0);
  if (sensorValue > sensorHigh); {
    sensorHigh=sensorValue;
}

//Set sensor low
  if (sensorValue < sensorLow); {
    sensorLow=sensorValue;
}  
  }
//Turn off LED to indicate calibration is complete
digitalWrite(ledPin, LOW);
}


void loop() {
 //Read the sensor value 
sensorValue = analogRead (A0);

int pitch =
  map (sensorValue,sensorLow,sensorHigh, 50, 4000); 

tone (8,pitch,20);

//Delay to give sound time to play
delay (50);
  
}

I am happy for any feedback :slight_smile:
Thank You!

if (sensorValue > sensorHigh);lose the semicolon

Thank you so much for your good help! :slight_smile:
So nice seeing the project work.

This is the first time i've used too many semi-colons :stuck_out_tongue: