#include <Servo.h>
Servo lightservo;
void setup() {
lightservo.attach(9);
}
void loop() {
int lightvalue = analogRead(A0);
lightvalue = map (lightvalue, 0, 1023, 0, 180);
lightservo.write (lightvalue);
}#include <Servo.h>
Servo lightservo;
void setup() {
lightservo.attach(9);
}
void loop() {
int lightvalue = analogRead(A0);
lightvalue = map (lightvalue, 0, 1023, 0, 180);
lightservo.write (lightvalue);
}