Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Pulse
Fork of RangeFinder by
RangeFinder Class Reference
Range Finder class. More...
#include <RangeFinder.h>
Public Member Functions | |
| RangeFinder (PinName pin, int pulsetime, float scale, int timeout) | |
| Create a RangeFinder object. | |
| float | read_m () |
| Return the distance to the nearest object, or -1.0 if reading the pulse timed out. | |
Detailed Description
Range Finder class.
Definition at line 30 of file RangeFinder.h.
Constructor & Destructor Documentation
| RangeFinder | ( | PinName | pin, |
| int | pulsetime, | ||
| float | scale, | ||
| int | timeout | ||
| ) |
Create a RangeFinder object.
- Parameters:
-
pin Digital I/O pin the range finder is connected to. pulsetime Time of pulse to send to the rangefinder to trigger a measurement, in microseconds. scale Scaling of the range finder's output pulse from microseconds to metres. timeout Time to wait for a pulse from the range finder before giving up.
Definition at line 25 of file RangeFinder.cpp.
Member Function Documentation
| float read_m | ( | ) |
Return the distance to the nearest object, or -1.0 if reading the pulse timed out.
Definition at line 32 of file RangeFinder.cpp.
Generated on Sat Jul 16 2022 11:57:17 by
1.7.2
