Servo Motor Control
dear everyone,
i have uno kit , servo motor 24v , proximity sensor.
operation required:
1. when proximity switch detects object motor rotates 1 revolution if sensor goes low , stop rotating.
2. if sensor detects object while motor rotating no action taken untill motor stops.
3. control speed of servo motor per application requirements.
i have write code continuous operation below:
------------------------------------------
#include <servo.h>;
servo myservo;
int pos = 0;
void setup()
{
myservo.attach(3);
}
void loop()
{
for(pos = 0; pos <= 180; pos += 1)
{
myservo.write(pos);
delay(15);
}
for(pos = 180; pos >=0; pos-=1)
{
myservo.write(pos);
delay(15);
}
}
------------------------------------
any appreciated.
thanks in advance
i have uno kit , servo motor 24v , proximity sensor.
operation required:
1. when proximity switch detects object motor rotates 1 revolution if sensor goes low , stop rotating.
2. if sensor detects object while motor rotating no action taken untill motor stops.
3. control speed of servo motor per application requirements.
i have write code continuous operation below:
------------------------------------------
#include <servo.h>;
servo myservo;
int pos = 0;
void setup()
{
myservo.attach(3);
}
void loop()
{
for(pos = 0; pos <= 180; pos += 1)
{
myservo.write(pos);
delay(15);
}
for(pos = 180; pos >=0; pos-=1)
{
myservo.write(pos);
delay(15);
}
}
------------------------------------
any appreciated.
thanks in advance
first thing do, if that's 24v servo, check in datasheet if a) controlled 5v signal , b) if so, normal 1000-1500-2000ms signals use here in arduinoland.
(or know fact already?)
edit: sorry i missed below presumably know servo works library?
(or know fact already?)
edit: sorry i missed below presumably know servo works library?
quote
i have write code continuous operation below:
Arduino Forum > Using Arduino > Project Guidance > Servo Motor Control
arduino
Comments
Post a Comment