Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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