Sharp GP2 familly distance sensor library

Dependents:   FRC_2018 0hackton_08_06_18 0hackton_08_06_18_publish Kenya_2019 ... more

Revision:
6:36744d1b3127
Parent:
5:49fb7016797c
--- a/GP2A.h	Sun Oct 13 13:35:59 2019 +0000
+++ b/GP2A.h	Sun Oct 13 13:43:07 2019 +0000
@@ -31,10 +31,12 @@
  *      slope :         is the slope of the linear part of the graph V = f(1/d)
  *                      take special care that we use the 1/d instead of d for x
  *                      axis.
+ *      origin :        is the value of the origin (Y for X = 0) of the line of 
+ *                      V=f(1/d)
  *  The slope parameter must be computed by user unless the GP2 reference is
  *  listed in the list below :
- *      - GP2Y0A02YK0F (Min = 30cm, Max = 150cm, Slope = 55)
- *      - GP2Y0A21YK0F (Min =  7cm, Max =  80cm, Slope = 10)
+ *      - GP2Y0A02YK0F (Min = 30cm, Max = 150cm, Slope = 60, origin = 0)
+ *      - GP2Y0A21YK0F (Min =  7cm, Max =  80cm, Slope = 0.246, origin = -0.297)
  *
  *  You may add others sensors if you wish it
  *
@@ -63,6 +65,8 @@
 /**
  * GP2A Sensor : See sharp website for more informations
  *  http://www.sharp-world.com/products/device/lineup/selection/opto/haca/diagram.html
+ *  @param slope = 60 for a GP2Y0A02 and 0.236 for a GP2Y0A21
+ *  @param origin = 0 for a GP2Y0A02 and -0.297 for a GP2Y0A21
  */
 class GP2A {