Defines | Functions
D:/DRISSI/arduino-0022/arduino-0022/libraries/dynamixel/dynamixel.h File Reference

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

#include <WProgram.h>
#include <TimerOne/TimerOne.h>

Go to the source code of this file.

Defines

#define PING   0x01
#define READ   0x02
#define READ_DATA   0x02
#define WRITE   0x03
#define WRITE_DATA   0x03
#define REG_WRITE   0x04
#define ACTION   0x05
#define RESET   0x06
#define SYNC_WRITE   0x83
#define __DEBUG__DYNAMIXEL__

Functions

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

Detailed Description

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

For more information about frames, see the Robotis documentation and go to Product Information > Dynamixel > Communication > Instruction / Status Packet.

dynamixel.cpp
The C++ File Reference.

Dynamixel
A class which uses the present library.

Definition in file dynamixel.h.


Define Documentation

#define ACTION   0x05

Instruction which execute the last REG_WRITE send (if any)

Definition at line 44 of file dynamixel.h.

#define PING   0x01

Instruction to send a ping

Definition at line 32 of file dynamixel.h.

#define READ   0x02

Instruction to read a data

Definition at line 34 of file dynamixel.h.

#define READ_DATA   0x02

Equivalent to READ

Definition at line 36 of file dynamixel.h.

#define REG_WRITE   0x04

Instruction that works like WRITE but wait ACTION to execute

Definition at line 42 of file dynamixel.h.

#define RESET   0x06

Instruction to return servo to factory presets

Definition at line 46 of file dynamixel.h.

#define SYNC_WRITE   0x83

Instruction to command several servos simultaneously

Definition at line 48 of file dynamixel.h.

#define WRITE   0x03

Instruction to write a data

Definition at line 38 of file dynamixel.h.

#define WRITE_DATA   0x03

Equivalent to WRITE

Definition at line 40 of file dynamixel.h.


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.