標題:
兩輪平衡車stm32程序
[打印本頁]
作者:
a43769745
時間:
2018-5-7 10:34
標題:
兩輪平衡車stm32程序
兩輪平衡車程序
stm32源程序如下:
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "oled.h"
#include "PWM.h"
#include "timer.h"
#include "PID.h"
#include "stm32f10x_tim.h"
#include "24l01.h"
extern float Pitch1,Pitch_last,out1,out2,c4,Gyro_Y,Yaw;
extern int Encoder_Right,Encoder_Left;
extern short aay;
float speed;
u8 tmp_buf[8];
int main(void)
{
delay_init(); //延時函數(shù)初始化
NVIC_Configuration(); //設置NVIC中斷分組2:2位搶占優(yōu)先級,2位響應優(yōu)先級
uart_init(9600); //串口初始化為9600
MPU6050_initialize();
IIC_Init();
DMP_Init();
OLED_Init();
pwm_Init();
OLED_Refresh_Gram();
time1_Init();
PID_init();
//NRF24L01_Init();
//NRF24L01_RX_Mode();
while(1)
{
xianshi();
printf("gyro[1]=%f\r\n",Yaw);
}
}
復制代碼
所有資料51hei提供下載:
兩輪平衡小車.rar
(356.95 KB, 下載次數(shù): 32)
2018-5-8 02:13 上傳
點擊文件名下載附件
開源代碼
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1