A distance measurement class using ultrasonic sensor HC-SR04.
Dependents: Esercitazione4_4 HC-SR04 Group10_slave Oled_Gus ... more
The purpose of this library is to encourage students to develope their own classes. Instructions how to follow the development of this library for ultrasonic distance measurement are given here.
Diff: HCSR04.h
- Revision:
- 3:9a7899cf5e3a
- Parent:
- 2:aa59a9c531be
- Child:
- 4:aae70f15357f
--- a/HCSR04.h Sat Dec 05 09:42:14 2015 +0000 +++ b/HCSR04.h Sun Dec 06 15:13:54 2015 +0000 @@ -40,6 +40,8 @@ DigitalOut trigger; // trigger pin Timer timer; // echo pulsewidth measurement float distance; // store the distance in cm + float minDistance; // minimum measurable distance + float maxDistance; // maximum measurable distance /** Start the timer. */ void startTimer();