Mouse code for the MacroRat
irpair.h
- Committer:
- sahilmgandhi
- Date:
- 2017-05-24
- Revision:
- 29:ec2c5a69acd6
- Parent:
- 24:e7063765d6f0
- Child:
- 33:68ce1f74ab5f
File content as of revision 29:ec2c5a69acd6:
#ifndef IRPAIR_H #define IRPAIR_H #include "mbed.h" #define samplesToTake 1000 class IRPair { public: IRPair( PinName pin, PinName rec ) : ir( pin ), recv( rec ) { calibrateSensor(); } float getSamples( int i ); float sensorAvg; void calibrateSensor(); private: // internal values DigitalOut ir; AnalogIn recv; }; #endif