單片機源程序如下:
- #include "main.h"
- uint32_t Upload_Speed = 1; //數據上傳速度 單位 Hz
- #define upload_time (1000000/Upload_Speed) //計算上傳的時間。單位為us
- uint16_t power1=0,power2=0;
- uint32_t system_micrsecond; //系統時間 單位ms
- int main(void)
- {
- ControtLoopTaskInit(); //app init
- RemoteTaskInit();
- delay_ms(800);
- BSP_Init();
- system_micrsecond = Get_Time_Micros();
- while(1)
- {
- IMU_getYawPitchRoll(angle);
- if((Get_Time_Micros() - system_micrsecond) > upload_time)
- {
- system_micrsecond = Get_Time_Micros();
- UploadParameter(); //upload data to the PC
- delay_ms(1);
- }
- }
- }
復制代碼
所有資料51hei提供下載:
RM2016_INFANTRY_OPEN_SOURCEV.1.6.4.rar
(664.43 KB, 下載次數: 15)
2018-4-9 00:52 上傳
點擊文件名下載附件
云臺開源 下載積分: 黑幣 -5
|