lm3531
LM35.h@0:b83c07e29cbb, 2016-12-03 (annotated)
- Committer:
- arturogasca
- Date:
- Sat Dec 03 11:43:42 2016 +0000
- Revision:
- 0:b83c07e29cbb
lm35
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
arturogasca | 0:b83c07e29cbb | 1 | /* LM35.h */ |
arturogasca | 0:b83c07e29cbb | 2 | #ifndef LM35_H_ |
arturogasca | 0:b83c07e29cbb | 3 | #define LM35_H_ |
arturogasca | 0:b83c07e29cbb | 4 | |
arturogasca | 0:b83c07e29cbb | 5 | #include "mbed.h" |
arturogasca | 0:b83c07e29cbb | 6 | |
arturogasca | 0:b83c07e29cbb | 7 | |
arturogasca | 0:b83c07e29cbb | 8 | /** |
arturogasca | 0:b83c07e29cbb | 9 | */ |
arturogasca | 0:b83c07e29cbb | 10 | class LM35 |
arturogasca | 0:b83c07e29cbb | 11 | { |
arturogasca | 0:b83c07e29cbb | 12 | public: |
arturogasca | 0:b83c07e29cbb | 13 | /** Constructor |
arturogasca | 0:b83c07e29cbb | 14 | */ |
arturogasca | 0:b83c07e29cbb | 15 | LM35(PinName pin); |
arturogasca | 0:b83c07e29cbb | 16 | |
arturogasca | 0:b83c07e29cbb | 17 | /** Destructor |
arturogasca | 0:b83c07e29cbb | 18 | */ |
arturogasca | 0:b83c07e29cbb | 19 | ~LM35(); |
arturogasca | 0:b83c07e29cbb | 20 | |
arturogasca | 0:b83c07e29cbb | 21 | /** Get temperature |
arturogasca | 0:b83c07e29cbb | 22 | */ |
arturogasca | 0:b83c07e29cbb | 23 | float get(); |
arturogasca | 0:b83c07e29cbb | 24 | |
arturogasca | 0:b83c07e29cbb | 25 | private: |
arturogasca | 0:b83c07e29cbb | 26 | |
arturogasca | 0:b83c07e29cbb | 27 | AnalogIn sensorPin; |
arturogasca | 0:b83c07e29cbb | 28 | float tempC,a[10],avg; |
arturogasca | 0:b83c07e29cbb | 29 | int i; |
arturogasca | 0:b83c07e29cbb | 30 | |
arturogasca | 0:b83c07e29cbb | 31 | }; |
arturogasca | 0:b83c07e29cbb | 32 | |
arturogasca | 0:b83c07e29cbb | 33 | #endif /* LM35_H_ */ |