From e9a12cb02b86e7ac5e6180a33a77ecfc3d3228d9 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sat, 13 Jun 2020 11:02:51 +0200 Subject: [PATCH] Add Alarm Function to Example Decoder --- Firmware/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Firmware/README.md b/Firmware/README.md index 68b2248..7a9939e 100644 --- a/Firmware/README.md +++ b/Firmware/README.md @@ -25,6 +25,10 @@ function Decoder(bytes, port) { // We always have Battery Voltage (uint8_t) decoded.v = (bytes[0] * 20) / 1000.0; + // Alarm Triggered (uint8_t) + if (bytes.length == 2) + decoded.a = bytes(1); + // Temperature (int32_t) if (bytes.length >= 5) decoded.t = ((bytes[1]) | (bytes[2] << 8 ) | (bytes[3] << 16 ) | (bytes[4] << 24)) / 100.0;