Sharp GP2 familly distance sensor library
GP2A Class Reference
Includes : Mbed library. More...
|GP2A (PinName vmes, float dMin, float dMax, float slope, float origin=0)|
|Constructor of a Sharp GP2 Familly object. |
|Return the distance to target mesured by sensor in cm. |
|Return the current voltage on GP2A output. |
|operator double ()|
|A short hand of getDistance. |
Includes : Mbed library.
GP2A Sensor : See sharp website for more informations http://www.sharp-world.com/products/device/lineup/selection/opto/haca/diagram.html
slope = 60 for a GP2Y0A02 and 0.236 for a GP2Y0A21 origin = 0 for a GP2Y0A02 and -0.297 for a GP2Y0A21
Constructor & Destructor Documentation
|float|| origin =
Constructor of a Sharp GP2 Familly object.
vmes (PinName) : the Mbed pin used to connect with GP2A sensor dMin (double) : the GP2A sensor min distance to mesure dMax (double) : the GP2A sensor max distance to mesure slope (double) : the slope of the linear part of the graph V = f(1/d) origin (double) : the origin (Y for X=0) of the linear pat of the graph V = f(1/d)
- you better use slope and origin value that I've put above as sybolic constants
Member Function Documentation
Generated on Tue Jul 19 2022 01:17:47 by 1.7.2