DS18B20 TEMPERATURE_PRECISION increased to 12 bits and temp converted to float

This commit is contained in:
2018-10-14 03:20:50 +03:00
parent 3038e41788
commit 687ef7cd99
10 changed files with 93 additions and 88 deletions

View File

@@ -27,11 +27,9 @@ e-mail anklimov@gmail.com
OneWire *net = NULL;
// Pass our oneWire reference to Dallas Temperature.
//DallasTemperature sensors(&net);
DeviceAddress *term = NULL;
//int *regs = NULL;
uint16_t *wstat = NULL;
DallasTemperature *sensors = NULL;
@@ -46,8 +44,8 @@ int owUpdate() {
unsigned long finish = millis() + OW_UPDATE_INTERVAL;
short sr;
//net.setStrongPullup();
debugSerial.println(F("Searching"));
Serial.println(F("Searching"));
if (net) net->reset_search();
for (short i = 0; i < t_count; i++) wstat[i] &= ~SW_FIND; //absent
@@ -153,12 +151,12 @@ int sensors_loop(void) {
return 8000;
}
int t;
float t;
switch (term[si][0]) {
case 0x28: // Thermomerer
t = sensors->getTempC(term[si]);//*10.0;
//debugSerial.println("o");
//Serial.println("o");
if (owChanged) owChanged(si, term[si], t);
sensors->requestTemperaturesByAddress(term[si]);
si++;