Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RoboClaw TestMyPathFind Robot2016_2-0_STATIC Stressed ... more
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:
-
address address of the device speed speed 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:
-
address address of the device speed speed 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:
-
address address 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:
-
address address of the device
Definition at line 113 of file RoboClaw.cpp.
| void ResetEnc | ( | ) |
Set both encoders to zero.
- Parameters:
-
address address 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:
-
address address 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.
Generated on Tue Jul 12 2022 19:03:11 by
1.7.2