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.
Fork of DS1820 by
DS1820.h
00001 #ifndef DS1820_H_ 00002 #define DS1820_H_ 00003 00004 #include <OneWire.h> 00005 #include "mbed_debug.h" 00006 00007 #define DEBUG 0 00008 00009 class DS1820 { 00010 OneWire oneWire; 00011 bool present; 00012 bool model_s; 00013 uint8_t data[12]; 00014 uint8_t addr[8]; 00015 00016 public: 00017 00018 DS1820(PinName pin); 00019 00020 DS1820(char model, PinName pin); 00021 00022 bool begin(void); 00023 00024 bool isPresent(); 00025 00026 void setResolution(uint8_t res); 00027 00028 virtual void startConversion(void); 00029 00030 virtual uint8_t readRaw(uint16_t &temp); 00031 00032 uint8_t read(float &temp); 00033 00034 protected: 00035 float toFloat(uint16_t word); 00036 }; 00037 00038 #endif /* DS1820_H_ */
Generated on Mon Jul 18 2022 07:52:01 by
1.7.2
