Functions | Variables
D:/DRISSI/arduino-0022/arduino-0022/libraries/dynamixel/dynamixel.cpp File Reference

Simple functions to communicate with servomotors RX-24F from Robotis. More...

#include "dynamixel.h"

Go to the source code of this file.

Functions

void InitDynamixel ()
void ISR_TimeOut_Dynamixel ()
void SendPacket (unsigned char ID, unsigned char Instruction, unsigned char *Parameters=0, int Nb=0)
int ReceivePacket (unsigned char *Buffer, int NbMax, long TimeOut_Us=1000000)
int Errors (unsigned char *Packet)
void EmptyReceptionBuffer ()

Variables

bool TimeOutFlag = false

Detailed Description

Simple functions to communicate with servomotors RX-24F from Robotis.

See also :

dynamixel.h
The header File Reference.

Dynamixel
A class which uses the present library.

Definition in file dynamixel.cpp.


Function Documentation

void EmptyReceptionBuffer ( )

Empty the reception buffer (usefull when a reception error occurenced)

Returns:
no return

Definition at line 176 of file dynamixel.cpp.

int Errors ( unsigned char *  Packet)

Check if a return packet contains no error

Parameters:
PacketThe return packet to check (a character's array)
Returns:
an int which represents if there is any error (0 means no error, 1 means error on the debut frame and 2 that there is an error on the error bit

Definition at line 127 of file dynamixel.cpp.

void InitDynamixel ( )

Initialize transmission with servomotors

Returns:
no return

Definition at line 14 of file dynamixel.cpp.

void ISR_TimeOut_Dynamixel ( )

Timeout for reception mode

Returns:
no return

Definition at line 27 of file dynamixel.cpp.

int ReceivePacket ( unsigned char *  Buffer,
int  NbMax,
long  TimeOut_Us 
)

Receive a return packet for servomotors (a timeout is specified to prevent a reception error)

Parameters:
BufferUsed to save communication reception
NbMaxDefines the length of data to read
TimeOut_UsDefines the length of the time out in microseconds
Returns:
an int that shows if the reception has succed (1 means a success and 0 a failure)

Definition at line 81 of file dynamixel.cpp.

void SendPacket ( unsigned char  ID,
unsigned char  Instruction,
unsigned char *  Parameters,
int  Nb 
)

Send a packet to all servos (if ID is defined as 0xFE) or just one (if another ID is specified)

Parameters:
IDDefines the servo to communicate with
InstructionThe instruction to send (see the defines chapter to know possible actions)
ParametersAn array which contains the parameters of the instruction (if any)
NbSpecifies the number of parameters
Returns:
no return

Definition at line 41 of file dynamixel.cpp.