#define sensorPin 0
#define lightPin 5
void setup() {
// put your setup code here, to run once:
pinMode(lightPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
// larger is darker. 853 is twilight
int newBrightness = analogRead(sensorPin);
newBrightness = map(newBrightness, 0, 1023, 0, 255);
analogWrite(lightPin, newBrightness);
delay(100);
}