标题: 自行设计STM32超声波程序 电平触发式 [打印本页]

作者: LLLBBB    时间: 2017-5-14 12:52
标题: 自行设计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();                  //延时初始化
  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. ……………………

  22. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
自行设计stm32超声波.rar (307.44 KB, 下载次数: 35)







欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1