You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By Julien de la Bruère-Terreault (drgfreeman@tuta.io)
7
7
@@ -38,7 +38,7 @@ Constructor: `pin` is the analog pin to which the sensor is connected, `size` is
38
38
Returns the measured distance. Distance units are in millimeters (mm) if using the library default settings or pre-defined sensor models. If using custom calibration, units depend on the calibration used.
39
39
40
40
*`void setModel(const byte model)`
41
-
Sets the calibration based on pre-defined sensor model fit functions.
41
+
Sets the calibration based on pre-defined sensor model fit functions. Note that the model argument must be preceded by the SharpDistSensor namespace, i.e.: `setModel(SharpDistSensor::Model_Name)`
Sets the polynomial fit function coefficients _C0_ to _C5_ in the relation:
@@ -54,17 +54,20 @@ where _A_ is the analog value read from the sensor. `valMin` and `valMax` define
54
54
Sets the range of analog values for which the polynomial or power fit is valid (`valMin` and `valMax`). Analog values outside this range will be set to the respective min or max values.
55
55
56
56
## Pre-defined sensor models
57
-
*`GP2Y0A60SZLF_5V` - GP2Y0A60SZLF Analog Distance Sensor 10-150cm, 5V
57
+
*`GP2Y0A60SZLF_5V` - GP2Y0A60SZLF Analog Distance Sensor 10-150cm, 5V
58
+
*`GP2Y0A710K0F_5V_DS` - GP2Y0A710K0F Analog Distance Sensor 100-500cm, 5V (data sheet)
58
59
59
60
Model | Units | C0 | C1 | C2 | C3 | C4 | C5 | valMin | valMax
**Important Note:** The analog voltage returned by the sensor is largely dependent of the reflected object size and reflectivity. The distance returned by these pre-defined calibration functions can therefore vary significantly from the real distance depending on the object detected. Where accuracy is required by the application, it is recommended to perform calibration with the object to be detected and use custom calibration fit functions instead.
64
66
65
67
This library has been designed so that it is easy to add sensor models. Contributions are therefore welcome. Adding models to the library can be done by either submitting a pull request or providing me the proposed fit function and associated calibration data by email so I can add it myself. Thank you for contributing!
0 commit comments