eBoard 🐩  ①⑧⑨
Written for SIA 2017/2018
ServoCds55 Struct Reference

[SPI] This is used to communicate with the smart servo shield
        Don't use manually More...

#include <eBoard.h>

Public Member Functions

 ServoCds55 (optVAL_t CS=53)
 The constructor. More...
 
void begin ()
 begin the communication and setup SPI More...
 
void WritePos (optVAL_t ID, optVAL_t Pos)
 Moves a Servo to a certain position. More...
 
void write (optVAL_t ID, optVAL_t Pos)
 Moves a Servo to a certain position. More...
 
void setVelocity (optVAL_t velocity)
 Sets the default speed of servos. More...
 
void setPosLimit (optVAL_t posLimit)
 Sets the position limits for the servos. More...
 
void rotate (optVAL_t, optVAL_t)
 makes nothing More...
 
void SetServoLimit (optVAL_t ID, optVAL_t upperLimit)
 (probably) set the posLimit for only one servo (will be overwritten by write() => writePos()) More...
 
void SetMotormode (optVAL_t ID, optVAL_t velocity)
 (probably) set the velocity of only one Servo More...
 
void SetID (optVAL_t ID, optVAL_t newID)
 change the ID of a special Servo More...
 
void Reset (optVAL_t ID)
 resets a servo More...
 
byte sendWait (const byte what)
 sends data. This is used internally and shouldnt be used! More...
 

Public Attributes

int upperLimit_temp
 stores the posLimit value send with write() More...
 

Private Attributes

optVAL_t velocity_temp
 stores the velocity value send with writePos() More...
 
optVAL_t cs
 stores the ControlPin id More...
 
byte tmp
 

Detailed Description

[SPI] This is used to communicate with the smart servo shield
        Don't use manually

Author
EagleoutIce
Warning
[COPY&PASTE] use SoccerBoard, DynamixelBoard and I2CInOut !
this code is for internal use only and shouldnt be used otherwise

[COPY&PASTE] [SPI] You can use this class like this:

_servoHandler.write(0,150); //will move servo id 0 to pos 150 [standard limit is 300]

[SPI] You can use this class like this:

//in setup:
//... in code:
_servoHandler.write(0,150); //will move servo id 0 to pos 150 [standard limit is 300]

Definition at line 2036 of file eBoard.h.

Constructor & Destructor Documentation

◆ ServoCds55()

ServoCds55::ServoCds55 ( optVAL_t  CS = 53)

The constructor.

Note
There should be only the already created _servoHandler.
This class isn't static!

Member Function Documentation

◆ begin()

void ServoCds55::begin ( )

begin the communication and setup SPI

◆ Reset()

void ServoCds55::Reset ( optVAL_t  ID)

resets a servo

Parameters
IDthe target ID of the Servo

◆ rotate()

void ServoCds55::rotate ( optVAL_t  ,
optVAL_t   
)

makes nothing

◆ sendWait()

byte ServoCds55::sendWait ( const byte  what)

sends data. This is used internally and shouldnt be used!

Parameters
whatthe byte to send
Returns
feedback of SPI.transfer();

◆ SetID()

void ServoCds55::SetID ( optVAL_t  ID,
optVAL_t  newID 
)

change the ID of a special Servo

Parameters
IDthe target ID of the Servo
newIDthe newID of the Servo
Warning
using this may result in a total failure of the program... pls no what you're doing!

◆ SetMotormode()

void ServoCds55::SetMotormode ( optVAL_t  ID,
optVAL_t  velocity 
)

(probably) set the velocity of only one Servo

Parameters
IDthe target ID of the Servo
velocity(probably) the speed for a specific servo
Warning
could do something different... lack of documentation

◆ setPosLimit()

void ServoCds55::setPosLimit ( optVAL_t  posLimit)

Sets the position limits for the servos.

Parameters
posLimitthe new positionLimit
Attention
the values are neither clamped nor masked!

◆ SetServoLimit()

void ServoCds55::SetServoLimit ( optVAL_t  ID,
optVAL_t  upperLimit 
)

(probably) set the posLimit for only one servo (will be overwritten by write() => writePos())

Parameters
IDthe target ID of the Servo
upperLimit(probably) the upperLimit for a specific servo
Warning
could do something different... lack of documentation

◆ setVelocity()

void ServoCds55::setVelocity ( optVAL_t  velocity)

Sets the default speed of servos.

Parameters
velocitythe new speed value...

◆ write()

void ServoCds55::write ( optVAL_t  ID,
optVAL_t  Pos 
)
inline

Moves a Servo to a certain position.

Parameters
IDthe target ID of the Servo
Posthe target position of the Servo

◆ WritePos()

void ServoCds55::WritePos ( optVAL_t  ID,
optVAL_t  Pos 
)

Moves a Servo to a certain position.

Parameters
IDthe target ID of the Servo
Posthe target position of the Servo
Note
don't use this function... use write() instead

Member Data Documentation

◆ cs

optVAL_t ServoCds55::cs
private

stores the ControlPin id

Definition at line 2134 of file eBoard.h.

◆ tmp

byte ServoCds55::tmp
private

Definition at line 2136 of file eBoard.h.

◆ upperLimit_temp

int ServoCds55::upperLimit_temp

stores the posLimit value send with write()

Definition at line 2128 of file eBoard.h.

◆ velocity_temp

optVAL_t ServoCds55::velocity_temp
private

stores the velocity value send with writePos()

Definition at line 2132 of file eBoard.h.


The documentation for this struct was generated from the following file: