Hobby Servo with Photo Resistor

This code might work. I don't have time to test it. This will at least give you a place to start. As for his school project this code is PART of it. I'm sure he will add to it.

#include <Servo.h> 
 
Servo myservo;  
int sensorValue = 0;
int sensorPin = A0; 
 
void setup() 
{ 

myservo.attach(9); 

} 
 
void loop() 
{ 
  
  sensorValue = analogRead(sensorPin);
  
  sensorValue = sensorValue / 5.7; 
 
 myservo.write(sensorValue);
 
delay(1200);

}