2024-07-11 18:14:13 +08:00
|
|
|
|
#ifndef __HCSR04_H
|
|
|
|
|
#define __HCSR04_H
|
|
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
|
|
2024-07-13 15:22:46 +08:00
|
|
|
|
extern uint32_t sonor_distance; // 测量出的距离,单位mm
|
|
|
|
|
extern uint8_t sonor_state; // 测距状态变量,0:未测量,1:正在测量,2:已测量
|
|
|
|
|
|
|
|
|
|
void HC_SR04_Init(void);
|
|
|
|
|
uint32_t sonar_mm(void);
|
|
|
|
|
|
|
|
|
|
// 测距完毕回调,执行完自定义任务后将sonor_state置0
|
2024-07-14 19:37:35 +08:00
|
|
|
|
void Sonar_CP_Callback(void);
|
2024-07-11 18:14:13 +08:00
|
|
|
|
|
|
|
|
|
#endif
|