From 453851d1dfc8f7c60e28735d5c48ef2768425d89 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Wed, 8 Jul 2020 18:24:40 +0200 Subject: [PATCH] Fix Typos, Add DS18B20 Decoder --- Firmware/README.md | 7 +++++++ Firmware/src/main.cpp | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Firmware/README.md b/Firmware/README.md index aab3827..13f47f0 100644 --- a/Firmware/README.md +++ b/Firmware/README.md @@ -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; diff --git a/Firmware/src/main.cpp b/Firmware/src/main.cpp index 3d9b6a3..7f633f6 100644 --- a/Firmware/src/main.cpp +++ b/Firmware/src/main.cpp @@ -34,8 +34,6 @@ #include #include - - // 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