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.
Dependents: HealthCare_Graduation
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__ */
Generated on Sun Jul 31 2022 21:32:44 by
1.7.2