111

Dependencies:   yezhong_main_controller_copy mbed1-dev

Committer:
ganlikun
Date:
Sat Jul 09 11:58:13 2022 +0000
Revision:
10:f83b0935a8f0
Parent:
0:d80c66cb1b3a
Child:
5:2503c88a564f
00000

Who changed what in which revision?

UserRevisionLine numberNew contents of line
panzhan 0:d80c66cb1b3a 1 #include "mode.h"
panzhan 0:d80c66cb1b3a 2 #include "CAN.h"
panzhan 0:d80c66cb1b3a 3
panzhan 0:d80c66cb1b3a 4
panzhan 0:d80c66cb1b3a 5
panzhan 0:d80c66cb1b3a 6 //
panzhan 0:d80c66cb1b3a 7 void Zero(CANMessage * msg){
panzhan 0:d80c66cb1b3a 8 msg->data[0] = 0xFF;
panzhan 0:d80c66cb1b3a 9 msg->data[1] = 0xFF;
panzhan 0:d80c66cb1b3a 10 msg->data[2] = 0xFF;
panzhan 0:d80c66cb1b3a 11 msg->data[3] = 0xFF;
panzhan 0:d80c66cb1b3a 12 msg->data[4] = 0xFF;
panzhan 0:d80c66cb1b3a 13 msg->data[5] = 0xFF;
panzhan 0:d80c66cb1b3a 14 msg->data[6] = 0xFF;
panzhan 0:d80c66cb1b3a 15 msg->data[7] = 0xFE;
panzhan 0:d80c66cb1b3a 16 WriteAll();
panzhan 0:d80c66cb1b3a 17 }
panzhan 0:d80c66cb1b3a 18
panzhan 0:d80c66cb1b3a 19
panzhan 0:d80c66cb1b3a 20 // 进入电机模式
panzhan 0:d80c66cb1b3a 21 void EnterMotorMode(CANMessage * msg){
panzhan 0:d80c66cb1b3a 22 msg->data[0] = 0xFF;
panzhan 0:d80c66cb1b3a 23 msg->data[1] = 0xFF;
panzhan 0:d80c66cb1b3a 24 msg->data[2] = 0xFF;
panzhan 0:d80c66cb1b3a 25 msg->data[3] = 0xFF;
panzhan 0:d80c66cb1b3a 26 msg->data[4] = 0xFF;
panzhan 0:d80c66cb1b3a 27 msg->data[5] = 0xFF;
panzhan 0:d80c66cb1b3a 28 msg->data[6] = 0xFF;
panzhan 0:d80c66cb1b3a 29 msg->data[7] = 0xFC;
panzhan 0:d80c66cb1b3a 30 WriteAll();
panzhan 0:d80c66cb1b3a 31 }
panzhan 0:d80c66cb1b3a 32
panzhan 0:d80c66cb1b3a 33
panzhan 0:d80c66cb1b3a 34 // 退出电机模式
panzhan 0:d80c66cb1b3a 35 void ExitMotorMode(CANMessage * msg){
panzhan 0:d80c66cb1b3a 36 msg->data[0] = 0xFF;
panzhan 0:d80c66cb1b3a 37 msg->data[1] = 0xFF;
panzhan 0:d80c66cb1b3a 38 msg->data[2] = 0xFF;
panzhan 0:d80c66cb1b3a 39 msg->data[3] = 0xFF;
panzhan 0:d80c66cb1b3a 40 msg->data[4] = 0xFF;
panzhan 0:d80c66cb1b3a 41 msg->data[5] = 0xFF;
panzhan 0:d80c66cb1b3a 42 msg->data[6] = 0xFF;
panzhan 0:d80c66cb1b3a 43 msg->data[7] = 0xFD;
panzhan 0:d80c66cb1b3a 44 WriteAll();
panzhan 0:d80c66cb1b3a 45 }