MakeBlock Drive Updated
Updated library for MakeBlock Ranger
Loading...
Searching...
No Matches
MeSmartServo.h File Reference

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"
Include dependency graph for MeSmartServo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sysex_message_type
 
struct  Cmd_list_tab_type
 
union  sysex_message
 
struct  servo_device_type
 
class  MeSmartServo
 Driver for Me Smart Servo device. More...
 

Macros

#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
 

Typedefs

typedef void(* smartServoCb) (uint8_t)
 

Variables

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 
 

Detailed Description

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:
  1. uint8_t MeSmartServo::readByte(uint8_t *argv,int16_t idx);
  2. short MeSmartServo::readShort(uint8_t *argv,int16_t idx,boolean ignore_high);
  3. float MeSmartServo::readFloat(uint8_t *argv,int16_t idx);
  4. long MeSmartServo::readLong(uint8_t *argv,int idx);
  5. uint8_t MeSmartServo::sendByte(uint8_t val);
  6. uint8_t MeSmartServo::sendShort(int16_t val,boolean ignore_high);
  7. uint8_t MeSmartServo::sendFloat(float val);
  8. uint8_t MeSmartServo::sendLong(long val);
  9. boolean MeSmartServo::assignDevIdRequest(void);
  10. boolean MeSmartServo::moveTo(uint8_t dev_id,long angle_value,float speed,smartServoCb callback);
  11. boolean MeSmartServo::move(uint8_t dev_id,long angle_value,float speed,smartServoCb callback);
  12. boolean MeSmartServo::setZero(uint8_t dev_id);
  13. boolean MeSmartServo::setBreak(uint8_t dev_id, uint8_t breakStatus);
  14. boolean MeSmartServo::setRGBLed(uint8_t dev_id, uint8_t r_value, uint8_t g_value, uint8_t b_value);
  15. boolean MeSmartServo::handSharke(uint8_t dev_id);
  16. boolean MeSmartServo::setPwmMove(uint8_t dev_id, int16_t pwm_value);
  17. boolean MeSmartServo::setInitAngle(uint8_t dev_id,uint8_t mode,int16_t speed);
  18. long MeSmartServo::getAngleRequest(uint8_t devId);
  19. float MeSmartServo::getSpeedRequest(uint8_t devId);
  20. float MeSmartServo::getVoltageRequest(uint8_t devId);
  21. float MeSmartServo::getTempRequest(uint8_t devId);
  22. float MeSmartServo::getCurrentRequest(uint8_t devId);
  23. void MeSmartServo::assignDevIdResponse(void *arg);
  24. void MeSmartServo::processSysexMessage(void);
  25. void MeSmartServo::smartServoEventHandle(void);
  26. void MeSmartServo::errorCodeCheckResponse(void *arg);
  27. void MeSmartServo::smartServoCmdResponse(void *arg);
History:
`<Author>`         `<Time>`        `<Version>`        `<Descr>`
Mark Yan         2016/08/23     1.0.0            Build the new.