基于stm32f103单片机的超声波模块的底层驱动 KEIL工程源码
int main(void)
{
/* 定时器初始化 */
Timer_Init();
/* 串口初始化 */
Uart_Init(1);
Uart_Init(2);
/* LED初始化 */
LED_Init();
/* 按键初始化 */
KEY_Init();
/* 蜂鸣器初始化 */
Beep_Init();
/* OLED显示屏初始化 */
OLED_Init();
/* 超声波初始化 */
SR04_Init();
while (1)
{
//if(KEY_Scan() == KEY0_PRES)
{
SR04_Triq();
// distance *= 10;
// UART_PutChar(USART1,(unsigned int)distance / 1000 + 0x30);
// UART_PutChar(USART1,(unsigned int)distance % 1000 / 100 + 0x30);
, 相关下载链接:
https://download.csdn.net/download/GJZGRB/87117206?utm_source=bbsseo