18 #include "../../SmingCore/Wire.h" 24 #define COPYSCRATCH 0x48 // Copy EEPROM 25 #define READSCRATCH 0xBE // Read EEPROM 26 #define WRITESCRATCH 0x4E // Write EEPROM 27 #define RECALLSCRATCH 0xB8 // Reload last 28 #define READPOWERSUPPLY 0xB4 // parasite power 29 #define ALARMSEARCH 0xEC // Query for alarm 30 #define STARTCONVO 0x44 // temperature reading 32 #define DS1820_WORK_PIN 2 // default DS1820 on GPIO2, can be changed by Init 46 DS18S20(uint8_t workPin = DS1820_WORK_PIN);
113 void StartReadNext();
114 uint8_t FindAlladdresses();
117 bool InProgress =
false;
124 uint8_t numberOfread=0;
Definition: OneWire.h:134
bool MeasureStatus()
Check if measurement is in progress.
uint8_t GetSensorsCount()
Get the quantity of sensors detected during last measurement.
bool IsValidTemperature(uint8_t)
Check if the last measurement for a sensor is valid.
uint64_t GetSensorID(uint8_t)
Get the ID (1-wire address) of a sensor.
void Init(uint8_t)
Initiate communication on 1-wire bus.
void StartMeasure()
Start measurement of all connected sensors.
void RegisterEndCallback(DS18S20CompletedDelegate)
Register the callback function that is run when measurement is complete.
Delegate< void()> DS18S20CompletedDelegate
Definition of callback function called on completion of measurement of all DS18S20 sensors...
Definition: ds18s20.h:37
float GetCelsius(uint8_t)
Get the value of the last measurment from a sensor.
float GetFahrenheit(uint8_t)
Get the value of the last measurment from a sensor.
This class implements access to the DS18x20 range of temperature sensors.
Definition: ds18s20.h:41
#define MAX_SENSORS
Maximum quantity of sensors to read.
Definition: ds18s20.h:20
void UnRegisterCallback()
Unregister the callback function to avoid activity after measurement is complete. ...
DS18S20(uint8_t workPin=DS1820_WORK_PIN)
Instantiate a DS18S20 object.