|
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "hc.h"
int main(void)
{
u8 t=0;
float length;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置中断优先级分组为组2:2位抢占优先级,2位响应优先级
delay_init(); //延时函数初始化
uart_init(115200); //串口初始化为115200
HC_Init();
while(1)
{
length = HcGetLength();
printf("距离为:%.3f",length);
printf("cm/n");
}
}
|
评分
-
查看全部评分
|