Arduino circuit 9

 

int ledPin = 9;
int photoPin = 0;
int light =0;

void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop()
{
light = analogRead(photoPin);
light = map(light, 0, 900, 0, 255);
if(light>100)
{
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
Serial.println(light);
}