標(biāo)題: 自行設(shè)計(jì)STM32超聲波程序 電平觸發(fā)式 [打印本頁]

作者: LLLBBB    時(shí)間: 2017-5-14 12:52
標(biāo)題: 自行設(shè)計(jì)STM32超聲波程序 電平觸發(fā)式
一個(gè)簡單的超聲波程序,電平觸發(fā)式

單片機(jī)源程序如下:
  1. #include "led.h"
  2. #include "delay.h"
  3. #include "sys.h"
  4. #include "key.h"
  5. #include "usart.h"
  6. #include "exti.h"
  7. #include "timer.h"
  8. #include "UltrasonicWave.h"


  9. int main(void)
  10. {
  11. // SystemInit();
  12.         delay_init();                  //延時(shí)初始化
  13.         NVIC_Configuration();
  14.         uart_init(9600);         //串口初始化
  15.          LED_Init();                            //LED端口初始化
  16.         KEY_Init();               //按鍵端口初始化
  17.         Timerx_Init(5000,7199);   //10Khz的計(jì)數(shù)頻率,計(jì)數(shù)到5000為500ms
  18.         UltrasonicWave_Configuration();               //對超聲波模塊初始化

  19.         while(1)
  20.         {
  21. ……………………

  22. …………限于本文篇幅 余下代碼請從51黑下載附件…………
復(fù)制代碼

所有資料51hei提供下載:
自行設(shè)計(jì)stm32超聲波.rar (307.44 KB, 下載次數(shù): 35)







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1