標(biāo)題:
我的四軸stm32單片機(jī)源程序
[打印本頁(yè)]
作者:
qisheng657203
時(shí)間:
2018-5-10 11:06
標(biāo)題:
我的四軸stm32單片機(jī)源程序
我的四軸單片機(jī)源程序如下:
代碼:
#include "public.h"
int Init(void)
{
SYSTEM_SetClock(72); //初始化系統(tǒng)時(shí)鐘為72MHZ
uart_init(72,9600); //初始化串口為9600
IIC_Config(); //初始化IIC總線
TIM4_PWM_config(19999,71); //初始化TIM4為PWM輸出模式
TIM2_PWMI_init(0xffff,71); //初始化TIM2為輸入捕獲模式
MPU6050_Init(); //初始化MPU6050
HMC5883_Init(); //初始化HMC5883
MS5611_Init(); //初始化MS5611
Data_Init();
PID_Init();
unlock(); //電調(diào)解鎖
TIM3_config(500,71); //初始化TIM3為定時(shí)器模式 0.5ms 任務(wù)調(diào)度開(kāi)始
return 0;
}
int main(void)
{
/*system init*/
Init();
while(1)
{
;
}
}
所有資料51hei提供下載:
我的四軸.rar
(75.19 KB)
(下載次數(shù): 10, 2018-5-13 03:57 上傳)
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1