Header for for MeSmartServo.cpp module.
More...
#include <stdint.h>
#include <stdbool.h>
#include <Arduino.h>
#include "MeConfig.h"
#include "MeSerial.h"
#include "MePort.h"
Go to the source code of this file.
|
|
#define | ALL_DEVICE 0xff |
| |
|
#define | CUSTOM_TYPE 0x00 |
| |
|
#define | CTL_ASSIGN_DEV_ID 0x10 |
| |
|
#define | CTL_SYSTEM_RESET 0x11 |
| |
|
#define | CTL_READ_DEV_VERSION 0x12 |
| |
|
#define | CTL_SET_BAUD_RATE 0x13 |
| |
|
#define | CTL_CMD_TEST 0x14 |
| |
|
#define | CTL_ERROR_CODE 0x15 |
| |
|
#define | SMART_SERVO 0x60 |
| |
|
#define | SET_SERVO_PID 0x10 |
| |
|
#define | SET_SERVO_ABSOLUTE_POS 0x11 |
| |
|
#define | SET_SERVO_RELATIVE_POS 0x12 |
| |
|
#define | SET_SERVO_CONTINUOUS_ROTATION 0x13 |
| |
|
#define | SET_SERVO_MOTION_COMPENSATION 0x14 |
| |
|
#define | CLR_SERVO_MOTION_COMPENSATION 0x15 |
| |
|
#define | SET_SERVO_BREAK 0x16 |
| |
|
#define | SET_SERVO_RGB_LED 0x17 |
| |
|
#define | SERVO_SHARKE_HAND 0x18 |
| |
|
#define | SET_SERVO_CMD_MODE 0x19 |
| |
|
#define | GET_SERVO_STATUS 0x20 |
| |
|
#define | GET_SERVO_PID 0x21 |
| |
|
#define | GET_SERVO_CUR_POS 0x22 |
| |
|
#define | GET_SERVO_SPEED 0x23 |
| |
|
#define | GET_SERVO_MOTION_COMPENSATION 0x24 |
| |
|
#define | GET_SERVO_TEMPERATURE 0x25 |
| |
|
#define | GET_SERVO_ELECTRIC_CURRENT 0x26 |
| |
|
#define | GET_SERVO_VOLTAGE 0x27 |
| |
|
#define | SET_SERVO_CURRENT_ANGLE_ZERO_DEGREES 0x30 |
| |
|
#define | SET_SERVO_ABSOLUTE_ANGLE 0x31 |
| |
|
#define | SET_SERVO_RELATIVE_ANGLE 0x32 |
| |
|
#define | SET_SERVO_ABSOLUTE_ANGLE_LONG 0x33 |
| |
|
#define | SET_SERVO_RELATIVE_ANGLE_LONG 0x34 |
| |
|
#define | SET_SERVO_PWM_MOVE 0x35 |
| |
|
#define | GET_SERVO_CUR_ANGLE 0x36 |
| |
|
#define | SET_SERVO_INIT_ANGLE 0x37 |
| |
|
#define | REPORT_WHEN_REACH_THE_SET_POSITION 0x40 |
| |
|
#define | START_SYSEX 0xF0 |
| |
|
#define | END_SYSEX 0xF7 |
| |
|
#define | PROCESS_SUC 0x0F |
| |
|
#define | PROCESS_BUSY 0x10 |
| |
|
#define | PROCESS_ERROR 0x11 |
| |
|
#define | WRONG_TYPE_OF_SERVICE 0x12 |
| |
|
#define | DEFAULT_UART_BUF_SIZE 64 |
| |
|
|
typedef void(* | smartServoCb) (uint8_t) |
| |
|
|
union { | |
| |
|
uint8_t byteVal [8] | |
| |
|
double doubleVal | |
| |
| } | val8byte | |
| |
|
union { | |
| |
|
uint8_t byteVal [4] | |
| |
|
float floatVal | |
| |
|
long longVal | |
| |
| } | val4byte | |
| |
|
union { | |
| |
|
uint8_t byteVal [2] | |
| |
|
short shortVal | |
| |
| } | val2byte | |
| |
|
union { | |
| |
|
uint8_t byteVal [1] | |
| |
|
uint8_t charVal | |
| |
| } | val1byte | |
| |
Header for for MeSmartServo.cpp module.
- Author
- MakeBlock
- Version
- V1.0.0
- Date
- 2016/08/23
- Copyright
- This software is Copyright (C), 2012-2016, MakeBlock. Use is subject to license
conditions. The main licensing options available are GPL V2 or Commercial:
- Open Source Licensing GPL V2
- This is the appropriate option if you want to share the source code of your
application with everyone you distribute it to, and you also want to give them
the right to share who uses it. If you wish to use this software under Open
Source Licensing, you must contribute all your source code to the open source
community in accordance with the GPL Version 2 when your application is
distributed. See http://www.gnu.org/copyleft/gpl.html
- Description
- This file is a drive for Smart Servo device, The Smart Servo inherited the MeSerial class from SoftwareSerial.
- Method List:
- uint8_t MeSmartServo::readByte(uint8_t *argv,int16_t idx);
- short MeSmartServo::readShort(uint8_t *argv,int16_t idx,boolean ignore_high);
- float MeSmartServo::readFloat(uint8_t *argv,int16_t idx);
- long MeSmartServo::readLong(uint8_t *argv,int idx);
- uint8_t MeSmartServo::sendByte(uint8_t val);
- uint8_t MeSmartServo::sendShort(int16_t val,boolean ignore_high);
- uint8_t MeSmartServo::sendFloat(float val);
- uint8_t MeSmartServo::sendLong(long val);
- boolean MeSmartServo::assignDevIdRequest(void);
- boolean MeSmartServo::moveTo(uint8_t dev_id,long angle_value,float speed,smartServoCb callback);
- boolean MeSmartServo::move(uint8_t dev_id,long angle_value,float speed,smartServoCb callback);
- boolean MeSmartServo::setZero(uint8_t dev_id);
- boolean MeSmartServo::setBreak(uint8_t dev_id, uint8_t breakStatus);
- boolean MeSmartServo::setRGBLed(uint8_t dev_id, uint8_t r_value, uint8_t g_value, uint8_t b_value);
- boolean MeSmartServo::handSharke(uint8_t dev_id);
- boolean MeSmartServo::setPwmMove(uint8_t dev_id, int16_t pwm_value);
- boolean MeSmartServo::setInitAngle(uint8_t dev_id,uint8_t mode,int16_t speed);
- long MeSmartServo::getAngleRequest(uint8_t devId);
- float MeSmartServo::getSpeedRequest(uint8_t devId);
- float MeSmartServo::getVoltageRequest(uint8_t devId);
- float MeSmartServo::getTempRequest(uint8_t devId);
- float MeSmartServo::getCurrentRequest(uint8_t devId);
- void MeSmartServo::assignDevIdResponse(void *arg);
- void MeSmartServo::processSysexMessage(void);
- void MeSmartServo::smartServoEventHandle(void);
- void MeSmartServo::errorCodeCheckResponse(void *arg);
- void MeSmartServo::smartServoCmdResponse(void *arg);
- History:
`<Author>` `<Time>` `<Version>` `<Descr>`
Mark Yan 2016/08/23 1.0.0 Build the new.