Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mode.cpp
00001 #include "mode.h" 00002 #include "CAN.h" 00003 00004 00005 00006 // 00007 void Zero(CANMessage * msg){ 00008 msg->data[0] = 0xFF; 00009 msg->data[1] = 0xFF; 00010 msg->data[2] = 0xFF; 00011 msg->data[3] = 0xFF; 00012 msg->data[4] = 0xFF; 00013 msg->data[5] = 0xFF; 00014 msg->data[6] = 0xFF; 00015 msg->data[7] = 0xFE; 00016 WriteAll(); 00017 } 00018 00019 00020 // 进入电机模式 00021 void EnterMotorMode(CANMessage * msg){ 00022 msg->data[0] = 0xFF; 00023 msg->data[1] = 0xFF; 00024 msg->data[2] = 0xFF; 00025 msg->data[3] = 0xFF; 00026 msg->data[4] = 0xFF; 00027 msg->data[5] = 0xFF; 00028 msg->data[6] = 0xFF; 00029 msg->data[7] = 0xFC; 00030 WriteAll(); 00031 } 00032 00033 00034 // 退出电机模式 00035 void ExitMotorMode(CANMessage * msg){ 00036 msg->data[0] = 0xFF; 00037 msg->data[1] = 0xFF; 00038 msg->data[2] = 0xFF; 00039 msg->data[3] = 0xFF; 00040 msg->data[4] = 0xFF; 00041 msg->data[5] = 0xFF; 00042 msg->data[6] = 0xFF; 00043 msg->data[7] = 0xFD; 00044 WriteAll(); 00045 }
Generated on Wed Jul 13 2022 08:32:47 by
