欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: stm32超聲波測距源程序資料 [打印本頁]

作者: 13709144461    時間: 2017-4-25 11:17
標題: stm32超聲波測距源程序資料
stm32超聲波測距資料


源程序:
  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(72);                  //延時初始化
  13.         NVIC_Configuration();
  14.         uart_init(9600);         //串口初始化
  15.         LED_Init();                            //LED端口初始化
  16.         KEY_Init();               //按鍵端口初始化
  17.         Timerx_Init(5000,7199);   //10Khz的計數頻率,計數到5000為500ms
  18.         UltrasonicWave_Configuration();               //對超聲波模塊初始化

  19.         while(1)
  20.         {
  21.                 UltrasonicWave_StartMeasure();                //開始測距,發送一個>10us的脈沖,然后測量返回的高電平時間

  22.                 LED0=!LED0;
  23.                 delay_ms(1000);       
  24.        
  25.                
  26.         }
  27. }

復制代碼

完整代碼:
STM32超聲波測距.zip (353.84 KB, 下載次數: 101)


作者: aaaaaa。    時間: 2019-4-18 19:00
迷你版的嗎




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