Mouse code for the MacroRat
Embed:
(wiki syntax)
Show/hide line numbers
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
Generated on Tue Jul 12 2022 17:41:24 by 1.7.2