Dallas' DS1820 family temperature sensor. For more details see [https://developer.mbed.org/users/hudakz/code/DS1820/wiki/Homepage]

Dependencies:   OneWire

Fork of DS1820 by Zoltan Hudak

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DS1820.h Source File

DS1820.h

00001 #ifndef DS1820_H_
00002     #define DS1820_H_
00003 
00004     #include <OneWire.h>
00005 
00006 class   DS1820
00007 {
00008     OneWire oneWire;
00009     bool    present;    
00010     bool    model_s;
00011     uint8_t data[12];
00012     uint8_t addr[8];
00013     float   toFloat(uint16_t word);
00014 public:
00015 
00016     DS1820(PinName pin);
00017     DS1820(char model, PinName pin);
00018     bool   begin(void);
00019     bool   isPresent();
00020     void   setResolution(uint8_t res);
00021     void   startConversion(void);
00022     float  read(void);
00023     uint8_t read(float& temp);
00024 };
00025 #endif /* DS1820_H_ */