1 #ifndef EAGLE_EBOARD_HELPLIB_SERVOCDS55 2 #define EAGLE_EBOARD_HELPLIB_SERVOCDS55 46 #if defined(__AVR_ATmega2560__) 65 void write(
int ID,
int Pos);
80 void rotate(
int ID,
int velocity);
101 void SetID(
int ID,
int newID);
147 digitalWrite(
cs,HIGH);
153 byte a = SPI.transfer (what);
154 delayMicroseconds (20);
164 int PosB = (Pos>>8 & 0xff);
165 int PosS = (Pos & 0xff);
168 digitalWrite(
cs, LOW);
173 digitalWrite(
cs, HIGH);
180 digitalWrite(
cs, LOW);
184 digitalWrite(
cs, HIGH);
189 int velocityB = (velocity>>8 & 0xff);
190 int velocityS = (velocity & 0xff);
191 digitalWrite(
cs, LOW);
195 digitalWrite(
cs, HIGH);
200 digitalWrite(
cs, LOW);
204 digitalWrite(
cs, HIGH);
209 digitalWrite(
cs, LOW);
212 digitalWrite(
cs, HIGH);
void SetServoLimit(int ID, int upperLimit)
(probably) set the posLimit for only one servo (will be overwritten by write() => writePos()) ...
int velocity_temp
stores the posLimit value send with write()
void SetMotormode(int ID, int velocity)
(probably) set the velocity of only one Servo
void setVelocity(int velocity)
Sets the default speed of servos.
byte sendWait(const byte what)
sends data. This is used internally and shouldnt be used!
void begin()
begin the communication and setup SPI
ServoCds55(int CS=10)
The constructor.
void rotate(int ID, int velocity)
makes nothing
void SetID(int ID, int newID)
change the ID of a special Servo
void WritePos(int ID, int Pos)
Moves a Servo to a certain position.
int upperLimit_temp
stores the posLimit value send with write()
void write(int ID, int Pos)
Moves a Servo to a certain position.
[SPI] This is used to communicate with the smart servo shield         Don't use manually ...
void Reset(int ID)
resets a servo
void setPoslimit(int posLimit)
Sets the position limits for the servos.
ServoCds55 _servoHandler
this is the "to_use" instance of ServoCds55
optVAL_t cs
stores the posLimit value send with write()