Fix Typos, Add DS18B20 Decoder

This commit is contained in:
seiichiro 2020-07-08 18:24:40 +02:00
parent b0767682cc
commit 453851d1df
2 changed files with 9 additions and 4 deletions

View File

@ -29,6 +29,13 @@ function Decoder(bytes, port) {
if (bytes.length == 2)
decoded.a = bytes[1];
// Temperature 2 * DS18B20
if (bytes.length == 6){
decoded.t1 = ((bytes[2]) | (bytes[3] << 8 )) / 100.0;
decoded.t2 = ((bytes[4]) | (bytes[5] << 8 )) / 100.0;
return decoded;
}
// Temperature (int32_t)
if (bytes.length >= 5)
decoded.t = ((bytes[1]) | (bytes[2] << 8 ) | (bytes[3] << 16 ) | (bytes[4] << 24)) / 100.0;

View File

@ -34,8 +34,6 @@
#include <avr/interrupt.h>
#include <tinySPI.h>
// secconfig.h Configures RF Module, TTN Keys / RF Networks and used Sensor
#include "secconfig.h"
@ -77,12 +75,12 @@
#elif ALARM_PIN == PIN_A1
#define ALARM_INT PCINT1
#elif ALARM_PIN == PIN_A2
#define ALARM_INT PCINT2HAS_BME280_ALARM
#define ALARM_INT PCINT2
#elif ALARM_PIN == PIN_A3
#define ALARM_INT PCINT3
#elif ALARM_PIN == PIN_A7
#define ALARM_INT PCINT7
#elif ALARM_PIN == PIN_B1
#elif ALARM_PIN == PIN_B2
#define ALARM_INT PCINT9
#endif
#endif