91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

調(diào)平衡車的時(shí)候用的軟件,最新版本界面友好,穩(wěn)定了很多,在win10上運(yùn)行沒有bug。自己寫了一個(gè)教程,希望大家喜歡!

資源截圖

代碼片段和文件信息

#include?“ANO_DT.h“
#include?“mpu6050.h“
#include?“flight_control.h“
#include?“24l01.h“
#include?“HCSR04.h“
#include?“usart.h“
#include?“stm32f10x_usart.h“
#include?“kalman.h“
#include?“stmflash.h“
#include?“adc.h“
#include?“debug_para.h“
/////////////////////////////////////////////////////////////////////////////////////
//數(shù)據(jù)拆分宏定義,在發(fā)送大于1字節(jié)的數(shù)據(jù)類型時(shí),比如int16、float等,需要把數(shù)據(jù)拆分成單獨(dú)字節(jié)進(jìn)行發(fā)送
#define?BYTE0(dwTemp)???????(?*(?(char?*)(&dwTemp)????)?)
#define?BYTE1(dwTemp)???????(?*(?(char?*)(&dwTemp)?+?1)?)
#define?BYTE2(dwTemp)???????(?*(?(char?*)(&dwTemp)?+?2)?)
#define?BYTE3(dwTemp)???????(?*(?(char?*)(&dwTemp)?+?3)?)


dt_flag_t?f;????????????//需要發(fā)送數(shù)據(jù)的標(biāo)志
u8?data_to_send[50];????//發(fā)送數(shù)據(jù)緩存
extern?float?motor_duty[4];
extern?struct?PID_parameter?PID_pitch?;??//姿態(tài)角PID
extern?struct?PID_parameter?PID_roll;
extern?struct?PID_parameter?PID_yaw;

extern?struct?PID_parameter?PID_gyro_x;??//角速度PID
extern?struct?PID_parameter?PID_gyro_y;
extern?struct?PID_parameter?PID_gyro_z;

extern?float?accel[3];

extern?struct?PID_parameter?PID_height;??//高度PID

extern?struct?Kalman_data?kalman_accel_x?;?????//三軸的加速度卡爾曼濾波數(shù)據(jù)(從左到右為last_p?Q?R?output)
extern?struct?Kalman_data?kalman_accel_y?;
extern?struct?Kalman_data?kalman_accel_z?;

extern?struct?Attitude_int?offset;?????//四旋翼靜態(tài)的時(shí)候6050測(cè)得的數(shù)據(jù)
extern?struct?Attitude_float?attitude;???//四旋翼當(dāng)前的姿態(tài)數(shù)據(jù)

extern?float?Power_V;

extern?struct?debug_data?debug;

/////////////////////////////////////////////////////////////////////////////////////
//Data_Exchange函數(shù)處理各種數(shù)據(jù)發(fā)送請(qǐng)求,比如想實(shí)現(xiàn)每5ms發(fā)送一次傳感器數(shù)據(jù)至上位機(jī),即在此函數(shù)內(nèi)實(shí)現(xiàn)
//此函數(shù)應(yīng)由用戶每1ms調(diào)用一次
void?ANO_DT_Data_Exchange(void)
{
????static?u8?cnt?=?0;
????static?u8?senser_cnt????=?10;
????static?u8?status_cnt????=?15;
????static?u8?motopwm_cnt???=?20;
static?u8?udata_cnt = 25;
????static?u8?power_cnt?????=?50; //計(jì)量值用來確定數(shù)據(jù)傳輸頻率
????
????if((cnt?%?senser_cnt)?==?(senser_cnt-1))
????????f.send_senser?=?1;??

????if((cnt?%?status_cnt)?==?(status_cnt-1))
????????f.send_status?=?1;??
????
????if((cnt?%?motopwm_cnt)?==?(motopwm_cnt-1))
????????f.send_motopwm?=?1;?
????
if((cnt?%?udata_cnt)?==?(udata_cnt-1))
f.udata?=1;
????if((cnt?%?power_cnt)?==?(power_cnt-1))
????????f.send_power?=?1; //到達(dá)計(jì)數(shù)值,標(biāo)志位置一
????
????cnt++;

/////////////////////////////////////////////////////////////////////////////////////
????if(f.send_status)//傳輸U(kuò)AV當(dāng)前狀態(tài)、姿態(tài)角、高度
????{
????????f.send_status?=?0;
????????ANO_DT_Send_Status(attitude.roll?attitude.pitch?attitude.yaw?attitude.height21);
????}???
/////////////////////////////////////////////////////////////////////////////////////
????else?if(f.send_senser)//傳輸傳感器數(shù)據(jù)6050和磁力計(jì)等數(shù)據(jù)
????{
????????f.send_senser?=?0;
????????ANO_DT_Send_Senser(debug.temp_duty_Kd*100?debug.temp_duty_Kp*100?debug.angleattitude.gyro_xattitude.gyro_yattitude.gyro_zaccel[0]accel[1]accel[2]);
????}???
??else?if(f.udata)
{
f.udata=0;
ANO_DT_Send_Udata(000000000);
}
////////////////////////////////

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????1344??2019-04-10?21:43??ANO_DT.h
?????文件????71165952??2018-11-03?10:37??ANO_TC匿名上位機(jī)V65.exe
?????文件?????1730904??2019-07-12?09:52??匿名V65簡(jiǎn)易使用說明.docx
?????文件???????15907??2019-04-10?22:48??ANO_DT.c

評(píng)論

共有 條評(píng)論