ARES / RoboClaw

Dependents:   RoboClaw TestMyPathFind Robot2016_2-0_STATIC Stressed ... more

Embed: (wiki syntax)

« Back to documentation index

RoboClaw Class Reference

RoboClaw Class Reference

The RoboClaw class, yo ucan use the library with : http://www.ionmc.com/RoboClaw-2x15A-Motor-Controller_p_10.html Used to control one or two motors with (or not) encoders. More...

#include <RoboClaw.h>

Public Member Functions

 RoboClaw (uint8_t adr, int baudrate, PinName rx, PinName tx)
 Create RoboClaw instance.
void ForwardM1 (int speed)
 Forward and Backward functions.
void Forward (int speed)
 Forward and Backward functions.
void ReadFirm ()
 Read the Firmware.
int32_t ReadEncM1 ()
 Read encoder and speed of M1 or M2.
void ResetEnc ()
 Set both encoders to zero.
void SpeedM1 (int32_t speed)
 Set speed of Motor with different parameter (only in ticks)

Detailed Description

The RoboClaw class, yo ucan use the library with : http://www.ionmc.com/RoboClaw-2x15A-Motor-Controller_p_10.html Used to control one or two motors with (or not) encoders.

 #include "mbed.h"
 #include "RoboClaw.h"

 RoboClaw roboclaw(115200, PA_11, PA_12);
 
 int main() {
     roboclaw.ForwardM1(ADR, 127);
     while(1);
 }

Definition at line 21 of file RoboClaw.h.


Constructor & Destructor Documentation

RoboClaw ( uint8_t  adr,
int  baudrate,
PinName  rx,
PinName  tx 
)

Create RoboClaw instance.

Definition at line 8 of file RoboClaw.cpp.


Member Function Documentation

void Forward ( int  speed )

Forward and Backward functions.

Parameters:
addressaddress of the device
speedspeed of the motor (between 0 and 127)
Note:
Forward and Backward functions, it turns the two motors

Definition at line 105 of file RoboClaw.cpp.

void ForwardM1 ( int  speed )

Forward and Backward functions.

Parameters:
addressaddress of the device
speedspeed of the motor (between 0 and 127)
Note:
Forward and Backward functions

Definition at line 89 of file RoboClaw.cpp.

int32_t ReadEncM1 (  )

Read encoder and speed of M1 or M2.

Parameters:
addressaddress of the device
Note:
Read encoder in ticks
Read speed in ticks per second

Definition at line 117 of file RoboClaw.cpp.

void ReadFirm (  )

Read the Firmware.

Parameters:
addressaddress of the device

Definition at line 113 of file RoboClaw.cpp.

void ResetEnc (  )

Set both encoders to zero.

Parameters:
addressaddress of the device

Definition at line 201 of file RoboClaw.cpp.

void SpeedM1 ( int32_t  speed )

Set speed of Motor with different parameter (only in ticks)

Parameters:
addressaddress of the device
Note:
Set the Speed
Set the Speed and Accel
Set the Speed and Distance
Set the Speed, Accel and Distance
Set the Speed, Accel, Decceleration and Position

Definition at line 205 of file RoboClaw.cpp.