Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers irpair.h Source File

irpair.h

00001 #ifndef IRPAIR_H
00002 #define IRPAIR_H
00003 
00004 #include "mbed.h"
00005 
00006 #define samplesToTake 1000
00007 
00008 class IRPair
00009 {
00010     public:
00011         IRPair( PinName pin, PinName rec ) : ir( pin ), recv( rec )
00012         {
00013             calibrateSensor();
00014         }
00015         
00016         double getSamples( int samples );
00017         
00018         float sensorAvg;
00019         void calibrateSensor();
00020         
00021     private:
00022         
00023         
00024         // internal values
00025         DigitalOut ir;
00026         AnalogIn recv;
00027         
00028 };
00029 
00030 
00031 
00032 #endif