|
基于STM32的智能避障程序
單片機源程序如下:
- #include "stm32f10x.h"
- #include "delay.h"
- #include "motor.h"
- #include "keysacn.h"
- #include "IRAvoid.h"
- #include <exti.h>
- /*
- void ZYSTM32_run(int speed,int time); //前進函數(shù)
- void ZYSTM32_brake(int time); //剎車函數(shù)
- void ZYSTM32_Left(int speed,int time); //左轉(zhuǎn)函數(shù)
- void ZYSTM32_Spin_Left(int speed,int time); //左旋轉(zhuǎn)函數(shù)
- void ZYSTM32_Right(int speed,int time); //右轉(zhuǎn)函數(shù)
- void ZYSTM32_Spin_Right(int speed,int time);//右旋轉(zhuǎn)函數(shù)
- void ZYSTM32_back(int speed,int time); //后退函數(shù)
- */
- int main(void)
- {
- delay_init();
- KEY_Init();
- IRAvoidInit();
- TIM4_PWM_Init(7199,0); //初始化PWM
- ZYSTM32_brake(500);
- keysacn();
-
- while(1)
- {
- GPIO_ResetBits(GPIOA,GPIO_Pin_4);
- GPIO_SetBits(GPIOB,GPIO_Pin_9);
- }
- }
復(fù)制代碼
所有資料51hei提供下載:
智能小車紅外避障實驗(帶后退掉頭避障).7z
(191.31 KB, 下載次數(shù): 13)
2019-3-6 02:20 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|
|