|
MakeBlock Drive Updated
Updated library for MakeBlock Ranger
|
Driver for Me Smart Servo device. More...
#include <src/MeSmartServo.h>


Public Member Functions | |
| MeSmartServo () | |
| MeSmartServo (uint8_t port) | |
| uint8_t | readByte (uint8_t *argv, int16_t idx) |
| short | readShort (uint8_t *argv, int16_t idx, boolean ignore_high) |
| float | readFloat (uint8_t *argv, int16_t idx) |
| long | readLong (uint8_t *argv, int idx) |
| uint8_t | sendByte (uint8_t val) |
| uint8_t | sendShort (int16_t val, boolean ignore_high) |
| uint8_t | sendFloat (float val) |
| uint8_t | sendLong (long val) |
| boolean | assignDevIdRequest (void) |
| boolean | moveTo (uint8_t dev_id, long angle_value, float speed, smartServoCb callback=NULL) |
| boolean | move (uint8_t dev_id, long angle_value, float speed, smartServoCb callback=NULL) |
| boolean | setZero (uint8_t dev_id) |
| boolean | setBreak (uint8_t dev_id, uint8_t breakStatus) |
| boolean | setRGBLed (uint8_t dev_id, uint8_t r_value, uint8_t g_value, uint8_t b_value) |
| boolean | handSharke (uint8_t dev_id) |
| boolean | setPwmMove (uint8_t dev_id, int16_t pwm_value) |
| boolean | setInitAngle (uint8_t dev_id, uint8_t=0, int16_t=40) |
| long | getAngleRequest (uint8_t devId) |
| float | getSpeedRequest (uint8_t devId) |
| float | getVoltageRequest (uint8_t devId) |
| float | getTempRequest (uint8_t devId) |
| float | getCurrentRequest (uint8_t devId) |
| void | assignDevIdResponse (void *arg) |
| void | errorCodeCheckResponse (void *arg) |
| void | smartServoCmdResponse (void *arg) |
| void | processSysexMessage (void) |
| void | smartServoEventHandle (void) |
Public Member Functions inherited from MeSerial | |
| MeSerial (void) | |
| MeSerial (uint8_t port) | |
| MeSerial (uint8_t receivePin, uint8_t transmitPin, bool inverse_logic=false) | |
| void | setHardware (bool mode) |
| void | begin (long baudrate) |
| size_t | write (uint8_t byte) |
| int | read () |
| int | available () |
| int16_t | poll (void) |
| void | end (void) |
| bool | listen (void) |
| bool | isListening (void) |
| void | sendString (char *str) |
| void | printf (char *fmt,...) |
| boolean | dataLineAvailable (void) |
| String | readDataLine (void) |
| String | concatenateWith (String s1, String s2) |
| char | letterOf (int i, String s) |
| int | stringLength (String s) |
| boolean | equalString (String s1, String s2) |
| float | getValue (String key) |
Public Member Functions inherited from MePort | |
| MePort (void) | |
| MePort (uint8_t port) | |
| MePort (uint8_t port, uint8_t slot) | |
| uint8_t | getPort (void) |
| uint8_t | getSlot (void) |
| bool | dRead1 (uint8_t mode=INPUT) |
| bool | dRead2 (uint8_t mode=INPUT) |
| bool | dpRead1 (void) |
| bool | dpRead2 (void) |
| void | dWrite1 (bool value) |
| void | dWrite2 (bool value) |
| int16_t | aRead1 (void) |
| int16_t | aRead2 (void) |
| void | aWrite1 (int16_t value) |
| void | aWrite2 (int16_t value) |
| void | reset (uint8_t port) |
| void | reset (uint8_t port, uint8_t slot) |
| uint8_t | pin1 (void) |
| uint8_t | pin2 (void) |
| uint8_t | pin (void) |
| uint8_t | pin (uint8_t port, uint8_t slot) |
Public Member Functions inherited from SoftwareSerial | |
| SoftwareSerial (uint8_t receivePin, uint8_t transmitPin, bool inverse_logic=false) | |
| void | begin (long speed) |
| bool | listen () |
| void | end () |
| bool | isListening () |
| bool | stopListening () |
| bool | overflow () |
| int | peek () |
| virtual void | flush () |
| operator bool () | |
Additional Inherited Members | |
Static Public Member Functions inherited from SoftwareSerial | |
| static void | handle_interrupt () __attribute__((__always_inline__)) |
Protected Attributes inherited from MeSerial | |
| bool | _hard |
| bool | _polling |
| bool | _scratch |
| int16_t | _bitPeriod |
| int16_t | _byte |
| long | _lastTime |
| char | buffer [64] |
| String | lastLine |
| int | bufferIndex |
Protected Attributes inherited from MePort | |
| uint8_t | s1 |
| uint8_t | s2 |
| uint8_t | _port |
| uint8_t | _slot |
Driver for Me Smart Servo device.
Class: MeSmartServo
| MeSmartServo::MeSmartServo | ( | ) |
Alternate Constructor which can call your own function to map the Me Smart Servo to arduino port, no pins are used or initialized here.
| [in] | None |
| MeSmartServo::MeSmartServo | ( | uint8_t | port | ) |
Alternate Constructor which can call your own function to map the Me Smart Servo to arduino port, If the hardware serial was selected, it will used the hardware serial.
| [in] | port | - RJ25 port from PORT_1 to M2 |
Alternate Constructor which can call your own function to map the Me Smart Servo to arduino port, If the hardware serial was selected, it will used the hardware serial.
| [in] | port | - RJ25 port from PORT_1 to M2. |
| boolean MeSmartServo::assignDevIdRequest | ( | void | ) |
| [in] | None |
| void MeSmartServo::assignDevIdResponse | ( | void * | arg | ) |
| [in] | None |
| [in] | *arg | - address of input parameter. |
| void MeSmartServo::errorCodeCheckResponse | ( | void * | arg | ) |
| [in] | *arg | - address of input parameter. |
| long MeSmartServo::getAngleRequest | ( | uint8_t | devId | ) |
| [in] | devId | - the device id of servo that we want to read its angle. |
| float MeSmartServo::getCurrentRequest | ( | uint8_t | devId | ) |
| [in] | devId | - the device id of servo that we want to read its current. |
| float MeSmartServo::getSpeedRequest | ( | uint8_t | devId | ) |
| [in] | devId | - the device id of servo that we want to read its speed. |
| float MeSmartServo::getTempRequest | ( | uint8_t | devId | ) |
| [in] | devId | - the device id of servo that we want to read its temperature. |
| float MeSmartServo::getVoltageRequest | ( | uint8_t | devId | ) |
| [in] | devId | - the device id of servo that we want to read its voltage. |
| boolean MeSmartServo::handSharke | ( | uint8_t | dev_id | ) |
| [in] | dev_id | - the device id of servo that we want to handsharke. |
| boolean MeSmartServo::move | ( | uint8_t | dev_id, |
| long | angle_value, | ||
| float | speed, | ||
| smartServoCb | callback = NULL |
||
| ) |
| [in] | dev_id | - the device id of servo that we want to move. |
| [in] | angle_value | - the relative angle value we want move to. |
| [in] | speed | - move speed value(The unit is rpm). |
| [in] | callback | - callback function when the target position has been reached(Optional parameters). |
| boolean MeSmartServo::moveTo | ( | uint8_t | dev_id, |
| long | angle_value, | ||
| float | speed, | ||
| smartServoCb | callback = NULL |
||
| ) |
| [in] | dev_id | - the device id of servo that we want to move. |
| [in] | angle_value | - the absolute angle value we want move to. |
| [in] | speed | - move speed value(The unit is rpm). |
| [in] | callback | - callback function when the target position has been reached(Optional parameters). |
| void MeSmartServo::processSysexMessage | ( | void | ) |
| [in] | None |
| uint8_t MeSmartServo::readByte | ( | uint8_t * | argv, |
| int16_t | idx | ||
| ) |
| [in] | *argv | - the buffer for input data. |
| [in] | idx | - the index used to identify the first address of read data. |
| float MeSmartServo::readFloat | ( | uint8_t * | argv, |
| int16_t | idx | ||
| ) |
| [in] | *argv | - the buffer for input data. |
| [in] | idx | - the index used to identify the first address of read data. |
| long MeSmartServo::readLong | ( | uint8_t * | argv, |
| int | idx | ||
| ) |
| [in] | *argv | - the buffer for input data. |
| [in] | idx | - the index used to identify the first address of read data. |
| short MeSmartServo::readShort | ( | uint8_t * | argv, |
| int16_t | idx, | ||
| boolean | ignore_high | ||
| ) |
| [in] | *argv | - the buffer for input data. |
| [in] | idx | - the index used to identify the first address of read data. |
| [in] | ignore_high | - is there have third byte high-level data. |
| uint8_t MeSmartServo::sendByte | ( | uint8_t | val | ) |
| [in] | val | - the byte data to be converted. |
| uint8_t MeSmartServo::sendFloat | ( | float | val | ) |
| [in] | val | - the short data to be converted. |
| uint8_t MeSmartServo::sendLong | ( | long | val | ) |
| [in] | val | - the short data to be converted. |
| uint8_t MeSmartServo::sendShort | ( | int16_t | val, |
| boolean | ignore_high | ||
| ) |
| [in] | val | - the short data to be converted. |
| [in] | ignore_high | - is there have third byte high-level data. |
| boolean MeSmartServo::setBreak | ( | uint8_t | dev_id, |
| uint8_t | breakStatus | ||
| ) |
| [in] | dev_id | - the device id of servo that we want to set. |
| [in] | breakStatus | - the break status of servo. |
| boolean MeSmartServo::setInitAngle | ( | uint8_t | dev_id, |
| uint8_t | mode = 0, |
||
| int16_t | speed = 40 |
||
| ) |
| [in] | dev_id | - the device id of servo that we want to set. |
| [in] | mode | - the return mode, 0 is the quick return mode. |
| [in] | speed | - the speed value return to init angle. |
| boolean MeSmartServo::setPwmMove | ( | uint8_t | dev_id, |
| int16_t | pwm_value | ||
| ) |
| [in] | dev_id | - the device id of servo that we want to set. |
| [in] | pwm_value | - the pwm value we wan't set the servo motor. |
| boolean MeSmartServo::setRGBLed | ( | uint8_t | dev_id, |
| uint8_t | r_value, | ||
| uint8_t | g_value, | ||
| uint8_t | b_value | ||
| ) |
| [in] | dev_id | - the device id of servo that we want to set. |
| [in] | r_value | - Red component. |
| [in] | g_value | - green component. |
| [in] | B_value | - Blue component. |
| boolean MeSmartServo::setZero | ( | uint8_t | dev_id | ) |
| [in] | dev_id | - the device id of servo that we want to initialization position. |
| void MeSmartServo::smartServoCmdResponse | ( | void * | arg | ) |
| [in] | *arg | - address of input parameter. |
| void MeSmartServo::smartServoEventHandle | ( | void | ) |
| [in] | None |