C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
hc_sr04.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "pico/stdlib.h"
14
19class HCSR04
20{
21private:
27 void trig();
28
29public:
36 HCSR04(uint trig_pin, uint echo_pin);
42 float get_distance();
43};
44
HCSR04(uint trig_pin, uint echo_pin)
Construct a new hc sr04 object.
Definition hc_sr04.cpp:6
void trig()
send a trig signal to HCSR04
Definition hc_sr04.cpp:17
uint trig_pin
the GPIO pin that send trigger signal to the HC-SR04 module
Definition hc_sr04.h:23
uint echo_pin
the GPIO pin where the HC-SR04 return echo signal
Definition hc_sr04.h:25
float get_distance()
request a measure from HCSR04
Definition hc_sr04.cpp:24