This commit is contained in:
proddy
2019-03-24 21:13:08 +01:00
parent 9d3ce7bcf0
commit d671e64c5f
23 changed files with 2286 additions and 1003 deletions

View File

@@ -4,9 +4,6 @@
*
* Paul Derbyshire - https://github.com/proddy/EMS-ESP
*
* See ChangeLog.md for history
* See README.md for Acknowledgments
*
*/
#pragma once
@@ -20,8 +17,8 @@
#define DS18_CHIP_DS1825 0x3B
#define DS18_DATA_SIZE 9
#define DS18_PARASITE 1
#define DS18_DISCONNECTED -127
#define DS18_CRC_ERROR -126
#define GPIO_NONE 0x99
#define DS18_READ_INTERVAL 2000 // Force sensor read & cache every 2 seconds
@@ -39,10 +36,11 @@ class DS18 {
DS18();
~DS18();
uint8_t setup(uint8_t gpio);
uint8_t setup(uint8_t gpio, bool parasite);
void loop();
char * getDeviceString(char * s, unsigned char index);
double getValue(unsigned char index);
int16_t getRawValue(unsigned char index); // raw values, needs / 16
protected:
bool validateID(unsigned char id);
@@ -50,6 +48,7 @@ class DS18 {
uint8_t loadDevices();
OneWire * _wire;
uint8_t _count; // # devices
uint8_t _gpio; // the sensor pin
uint8_t _count; // # devices
uint8_t _gpio; // the sensor pin
uint8_t _parasite; // parasite mode
};