Sharp IR GP2Y0A02YK0F

Dependencies:   mbed

Dependents:   SharpIR_test m3pi_object-avoider lab4_proximityGame_timer

Committer:
Tomas
Date:
Mon Aug 02 12:38:00 2010 +0000
Revision:
0:323d66022af5

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Tomas 0:323d66022af5 1 /* mbed SHARPIR distance sensor
Tomas 0:323d66022af5 2 * Copyright (c) 2010 Tomas Johansen
Tomas 0:323d66022af5 3 * Released under the MIT License: http://mbed.org/license/mit
Tomas 0:323d66022af5 4 */
Tomas 0:323d66022af5 5
Tomas 0:323d66022af5 6 #ifndef MBED_SHARPIR_H
Tomas 0:323d66022af5 7 #define MBED_SHARPIR_H
Tomas 0:323d66022af5 8
Tomas 0:323d66022af5 9 #include "mbed.h"
Tomas 0:323d66022af5 10
Tomas 0:323d66022af5 11 class SHARPIR {
Tomas 0:323d66022af5 12 public:
Tomas 0:323d66022af5 13 SHARPIR(PinName AnalogPort);
Tomas 0:323d66022af5 14 float cm();
Tomas 0:323d66022af5 15 float inch();
Tomas 0:323d66022af5 16 float volt();
Tomas 0:323d66022af5 17 void calibrate(double reg, float exp, double lowerrange, double higherrange);
Tomas 0:323d66022af5 18
Tomas 0:323d66022af5 19 private:
Tomas 0:323d66022af5 20 AnalogIn _analogin;
Tomas 0:323d66022af5 21 double lowerrange;
Tomas 0:323d66022af5 22 double higherrange;
Tomas 0:323d66022af5 23 double reg;
Tomas 0:323d66022af5 24 float exp; //trendline excel + datasheet
Tomas 0:323d66022af5 25 };
Tomas 0:323d66022af5 26
Tomas 0:323d66022af5 27 #endif