basic class for the use of the HC-SR04 ultrasound sensor
HC-SR04.h
- Committer:
- snapo
- Date:
- 2021-10-31
- Revision:
- 0:b4a6f6bcab30
File content as of revision 0:b4a6f6bcab30:
#pragma once #include "mbed.h" class HCSR04 { DigitalIn echo_ ; DigitalInOut trigger_; Timer t_; int time_us_; int distance_; public: HCSR04(PinName echo, PinName trigger); void reading(); void fastTimeReading(); int getTime(); int getDistance(); };