Duy tran / Thermometer

Dependents:   HealthCare_Graduation

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LM35.h Source File

LM35.h

00001 #ifndef __LM35_H__
00002 #define __LM35_H__
00003 
00004 #include "mbed.h"
00005 
00006 #define SAMPLE_COUNT    30
00007 
00008 class LM35Therm {
00009 private:
00010     AnalogIn *_pAin;
00011     bool  _isFirstRead;
00012     
00013     float _sumAnalog;
00014     float _calibrate;
00015     
00016     float analogSamples[SAMPLE_COUNT];
00017     float analogAverageSamples[SAMPLE_COUNT];    
00018 //    float _readVoltage;
00019     
00020 public:
00021     float tempInC;
00022     float tempInF;
00023     
00024     float averageAnalog;
00025     float filtedAvgAnalog;
00026     
00027     float _readVoltage;
00028     
00029 public:
00030     LM35Therm(PinName analogPin, float compensation);
00031     
00032     ~LM35Therm();
00033     
00034     void  getAverageValue();
00035     void  setCompensation(float newCompensation);
00036     float getTempInC();
00037     float getTempInF();    
00038         
00039 };
00040 
00041 #endif /* __LM35_H__ */