Shao Rui / CH_Communicatuin_Test2

Dependencies:   mbed-dev_spine

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers control.h Source File

control.h

00001 
00002 #ifndef CONTROL_H_
00003 #define CONTROL_H_
00004 #define FRAME_HEADER 0x55             //帧头
00005 #define CMD_SERVO_MOVE 0x03           //舵机du移动指令
00006 #define CMD_ACTION_GROUP_RUN 0x06     //运行动作组指令
00007 #define CMD_ACTION_GROUP_STOP 0x07    //停止ti动作组指令
00008 #define CMD_ACTION_GROUP_SPEED 0x0B   //设置动作组运行速度
00009 #define CMD_GET_BATTERY_VOLTAGE 0x0F  //获取电池电压指令
00010 #include "mbed.h"
00011 #include "data_pc.h"
00012 extern uint8_t LobotRxBuf[16];
00013 extern uint16_t batteryVolt;
00014 extern void receiveHandle(void);
00015 typedef struct _lobot_servo_ {  //舵机ID,舵机目标位置
00016     uint8_t ID;
00017     uint16_t Position;
00018 } LobotServo;
00019 
00020 
00021 void moveServo(uint8_t servoID, uint16_t Position, uint16_t Time);
00022 void getBatteryVoltage(void);
00023 void BaterryOut(void);
00024 
00025 
00026 #endif