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: IDW01M1-MQTT3 DS1820_IDW01M1 DS1820_IDW01M1_finish Dissolved_oxygen_sensor_online ... more
Fork of DS1820 by
DS1820.h
- Committer:
- hudakz
- Date:
- 2015-10-28
- Revision:
- 11:9be3e73c01f1
- Parent:
- 8:8dfdd1603e4d
File content as of revision 11:9be3e73c01f1:
#ifndef DS1820_H_
#define DS1820_H_
#include <OneWire.h>
class DS1820
{
OneWire oneWire;
bool present;
bool model_s;
uint8_t data[12];
uint8_t addr[8];
float toFloat(uint16_t word);
public:
DS1820(PinName pin);
DS1820(char model, PinName pin);
bool begin(void);
bool isPresent();
void setResolution(uint8_t res);
void startConversion(void);
float read(void);
uint8_t read(float& temp);
};
#endif /* DS1820_H_ */
