![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Sharp IR GP2Y0A02YK0F
Dependents: SharpIR_test m3pi_object-avoider lab4_proximityGame_timer
Diff: SHARPIR.h
- Revision:
- 0:323d66022af5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SHARPIR.h Mon Aug 02 12:38:00 2010 +0000 @@ -0,0 +1,27 @@ +/* mbed SHARPIR distance sensor + * Copyright (c) 2010 Tomas Johansen + * Released under the MIT License: http://mbed.org/license/mit + */ + +#ifndef MBED_SHARPIR_H +#define MBED_SHARPIR_H + +#include "mbed.h" + +class SHARPIR { +public: + SHARPIR(PinName AnalogPort); + float cm(); + float inch(); + float volt(); + void calibrate(double reg, float exp, double lowerrange, double higherrange); + +private: + AnalogIn _analogin; + double lowerrange; + double higherrange; + double reg; + float exp; //trendline excel + datasheet +}; + +#endif \ No newline at end of file