1

Dependencies:   mbed-dev_spine

Committer:
shaorui
Date:
Fri Mar 13 03:38:13 2020 +0000
Revision:
11:360230a179b9
Parent:
8:95a914f962bd
1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WXD 5:6a95726e45b0 1 #include "mode.h"
shaorui 8:95a914f962bd 2 #include "CAN.h"
WXD 5:6a95726e45b0 3
WXD 5:6a95726e45b0 4 //
WXD 5:6a95726e45b0 5 void Zero(CANMessage * msg){
WXD 5:6a95726e45b0 6 msg->data[0] = 0xFF;
WXD 5:6a95726e45b0 7 msg->data[1] = 0xFF;
WXD 5:6a95726e45b0 8 msg->data[2] = 0xFF;
WXD 5:6a95726e45b0 9 msg->data[3] = 0xFF;
WXD 5:6a95726e45b0 10 msg->data[4] = 0xFF;
WXD 5:6a95726e45b0 11 msg->data[5] = 0xFF;
WXD 5:6a95726e45b0 12 msg->data[6] = 0xFF;
WXD 5:6a95726e45b0 13 msg->data[7] = 0xFE;
shaorui 8:95a914f962bd 14 WriteAll();
WXD 5:6a95726e45b0 15 }
WXD 5:6a95726e45b0 16
WXD 5:6a95726e45b0 17
WXD 5:6a95726e45b0 18 // 进入电机模式
WXD 5:6a95726e45b0 19 void EnterMotorMode(CANMessage * msg){
WXD 5:6a95726e45b0 20 msg->data[0] = 0xFF;
WXD 5:6a95726e45b0 21 msg->data[1] = 0xFF;
WXD 5:6a95726e45b0 22 msg->data[2] = 0xFF;
WXD 5:6a95726e45b0 23 msg->data[3] = 0xFF;
WXD 5:6a95726e45b0 24 msg->data[4] = 0xFF;
WXD 5:6a95726e45b0 25 msg->data[5] = 0xFF;
WXD 5:6a95726e45b0 26 msg->data[6] = 0xFF;
WXD 5:6a95726e45b0 27 msg->data[7] = 0xFC;
shaorui 8:95a914f962bd 28 WriteAll();
WXD 5:6a95726e45b0 29 }
WXD 5:6a95726e45b0 30
WXD 5:6a95726e45b0 31
WXD 5:6a95726e45b0 32 // 退出电机模式
WXD 5:6a95726e45b0 33 void ExitMotorMode(CANMessage * msg){
WXD 5:6a95726e45b0 34 msg->data[0] = 0xFF;
WXD 5:6a95726e45b0 35 msg->data[1] = 0xFF;
WXD 5:6a95726e45b0 36 msg->data[2] = 0xFF;
WXD 5:6a95726e45b0 37 msg->data[3] = 0xFF;
WXD 5:6a95726e45b0 38 msg->data[4] = 0xFF;
WXD 5:6a95726e45b0 39 msg->data[5] = 0xFF;
WXD 5:6a95726e45b0 40 msg->data[6] = 0xFF;
WXD 5:6a95726e45b0 41 msg->data[7] = 0xFD;
shaorui 8:95a914f962bd 42 WriteAll();
WXD 5:6a95726e45b0 43 }
WXD 5:6a95726e45b0 44
WXD 5:6a95726e45b0 45
WXD 5:6a95726e45b0 46
WXD 5:6a95726e45b0 47
WXD 5:6a95726e45b0 48
WXD 5:6a95726e45b0 49
WXD 5:6a95726e45b0 50
WXD 5:6a95726e45b0 51
WXD 5:6a95726e45b0 52
WXD 5:6a95726e45b0 53
WXD 5:6a95726e45b0 54
WXD 5:6a95726e45b0 55
WXD 5:6a95726e45b0 56
WXD 5:6a95726e45b0 57
WXD 5:6a95726e45b0 58
WXD 5:6a95726e45b0 59
WXD 5:6a95726e45b0 60
WXD 5:6a95726e45b0 61
WXD 5:6a95726e45b0 62
WXD 5:6a95726e45b0 63
WXD 5:6a95726e45b0 64
WXD 5:6a95726e45b0 65
WXD 5:6a95726e45b0 66
WXD 5:6a95726e45b0 67