#include <Servo.h>
Servo s;
int ldr=A0;
void setup() {
// put your setup code here, to run once:
s.attach(5);
}
void loop() {
// put your main code here, to run repeatedly:
int v=analogRead(ldr);
int m=map(v,0,1023,0,180);
s.write(m);
}
#include <Servo.h>
Servo s;
int ldr=A0;
void setup() {
// put your setup code here, to run once:
s.attach(5);
}
void loop() {
// put your main code here, to run repeatedly:
int v=analogRead(ldr);
int m=map(v,0,1023,0,180);
s.write(m);
}