Add the following snippet to your HTML:
This is My 3rd project with Arduino.
Read up about this project on
This is my third project in Arduino.
Circuit diagram
ThankYou.
I'mHashanSudeera.
#include <Servo.h> Servo con_servo; int ldr=A0; void setup() { Serial.begin(9600); con_servo.attach(9); pinMode(ldr,INPUT); } void loop() { int x=analogRead(ldr); if(x<100){ con_servo.write(4); } if(x>100){ con_servo.write(20); } Serial.println(x); delay(0.4); }
Comments