Servo Motor Rotation For Perticular length
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup()
{
Serial.begin(9600);
myservo.attach(9);
}
void loop()
{
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
if(sensorValue>850)
{
myservo.write(0);
delay(5000);
}
else
{
myservo.write(90);
}
}
No comments:
Post a Comment