Sharp GP2 familly distance sensor library
Dependents: FRC_2018 0hackton_08_06_18 0hackton_08_06_18_publish Kenya_2019 ... more
Diff: GP2A.h
- Revision:
- 1:956ee3b2eaa0
- Parent:
- 0:17de10d278c2
- Child:
- 2:5e591a5b8edd
--- a/GP2A.h Fri May 18 16:47:44 2018 +0000 +++ b/GP2A.h Mon May 21 12:36:09 2018 +0000 @@ -3,8 +3,6 @@ * * @section LICENSE * - * Copyright (c) 2010 ARM Limited - * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -33,12 +31,16 @@ * 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. - * the slope parameter must be computed by user. You may - * also use the defined values (see below) + * The slope parameter must be computed by user unless the GP2 reference is + * listed in the list below : + * - GP2Y0A02YK0F (Min = 30cm, Max = 150cm, Slope = 60) + * - GP2Y0A21YK0F (Min = 7cm, Max = 80cm, Slope = 20.88) + * + * You may add others sensors if you wish it * * One must be aware that under the minimum distance the sensor will output * a false value of distance leading to strong errors. - * + * @endsection */ #ifndef GP2A_H @@ -57,7 +59,7 @@ #include "mbed.h" /** - * GP2A_Sensor + * GP2A Sensor */ class GP2A { @@ -76,14 +78,14 @@ /** * Return the distance to target in cm * - * @return : the distance in cm + * @return the distance in cm */ float getDistance (void); /** * Return the voltage on GP2A output * - * @return : the voltage between 0 and 3.3V + * @return the voltage between 0 and 3.3V */ float getVoltage (void);