quadcopter cufe / Mbed 2 deprecated FollowWall

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SHARPIR.h Source File

SHARPIR.h

00001 /* mbed SHARPIR distance sensor
00002  * Copyright (c) 2010 Tomas Johansen
00003  * Released under the MIT License: http://mbed.org/license/mit
00004  */
00005   
00006 #ifndef MBED_SHARPIR_H
00007 #define MBED_SHARPIR_H
00008 
00009 #include "mbed.h"
00010 
00011 class SHARPIR  {
00012 public:
00013     SHARPIR(PinName AnalogPort);
00014     float cm();
00015     float inch();
00016     float volt();
00017     void calibrate(double reg, float exp, double lowerrange, double higherrange);
00018 
00019 private:
00020     AnalogIn _analogin;
00021     double lowerrange;
00022     double higherrange;
00023     double reg;
00024     float  exp; //trendline excel + datasheet
00025 };
00026 
00027 #endif