Hi,
I'm very excited about starting my first project!
I got an Intel Galileo board connected with an Osepp LS-8101F servo.
All I wanna do for now is to set the servo position. I understand that I cannot use the standard Arduino servo library.
Instead I have to send highs and lows through the digital interface. Is that right?
I'm pretty sure everything is wired up correctly. Here is what I got so far:
#include <UtilTime.h>
int servoPin=3;
int t0;
int pulseLen=20000;
int maxLen=2000;
int min(int x,int y){
if(x<=y)return x;return y;}
void setup() {
// put your setup code here, to run once:
pinMode(servoPin,OUTPUT);
digitalWrite(servoPin,LOW);
t0=millis();
}
void loop() {
// put your main code here, to run repeatedly:
int highLen=1000+(millis()-t0)/20;
if(highLen>2000)
highLen=1500;
digitalWrite(servoPin,HIGH);
delayMicroseconds(highLen);
digitalWrite(servoPin,LOW);
delayMicroseconds(pulseLen-highLen);
}
The servo runs at a constant velocity and never stops.
I'd be really grateful if someone could point me to a reference or library that helps me set the servo position.
Thanks!