Automates the use of maximum 8 RC servomotors.
More...
Automates the use of maximum 8 RC servomotors.
Servo module uses timer 5.
Example :
#define BOARD Versa1
}
}
{
}
{
}
|
void | servoSet (unsigned char num, unsigned int val) |
| Set position of a servomotor. More...
|
|
|
void | servoReceive () |
| Module receive function, to be called by the fraiseReceive() user defined function. More...
|
|
void | servoSetPort (unsigned char num, unsigned char *port, unsigned char mask) |
|
#define | SERVO_SELECT_(num, connport, connbit) |
|
◆ servoSet()
void servoSet |
( |
unsigned char |
num, |
|
|
unsigned int |
val |
|
) |
| |
Set position of a servomotor.
- Parameters
-
num | Servomotor channel (0 to 7) |
val | New position of this servo, in 8/FOSC steps ; e.g for Versa1, FOSC=64MHz, so servo steps are 1/8 us : 8000 corresponds to 1 ms position.
|
◆ servoReceive()
Module receive function, to be called by the fraiseReceive() user defined function.
The first byte of the message represents the channel (0-7), the 2 next bytes are the 16 bit new position value. If the first byte equals to 254, then the message is for reading a channel position ; the next byte then is the actual channel, and the module sends to the master the current position of this channel.
◆ servoSelect
#define servoSelect |
( |
|
num, |
|
|
|
conn |
|
) |
| |
Select a pin for a servo channel.
- Parameters
-
num | Servomotor channel (0 to 7) |
conn | Symbol of the pin (example : K1 for connector 1)
|