Add Brightness Measurement Decoding to Payload Decoder
This commit is contained in:
parent
ab3c84e259
commit
2ff0e5f79e
|
@ -33,9 +33,17 @@ function Decoder(bytes, port) {
|
|||
if (bytes.length >= 9)
|
||||
decoded.h = ((bytes[5]) | (bytes[6] << 8 ) | (bytes[7] << 16 ) | (bytes[8] << 24)) / 100.0;
|
||||
|
||||
// Atmospheric Pressure (int32t)
|
||||
// SHT21 + Brightness (int16_t)
|
||||
if (bytes.length == 11)
|
||||
decoded.b = ((bytes[9]) | (bytes[10] << 8 ));
|
||||
|
||||
// Atmospheric Pressure (int32_t)
|
||||
if (bytes.length >= 13)
|
||||
decoded.p = ((bytes[9]) | (bytes[10] << 8 ) | (bytes[11] << 16 ) | (bytes[12] << 24)) / 100.0;
|
||||
|
||||
// BME280 + Brightness (int16_t)
|
||||
if (bytes.length == 15)
|
||||
decoded.b = ((bytes[13]) | (bytes[14] << 8 ));
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
|
|
@ -31,9 +31,10 @@
|
|||
#include <Arduino.h>
|
||||
#include <avr/sleep.h>
|
||||
#include <avr/wdt.h>
|
||||
#include <EEPROM.h>
|
||||
#include <tinySPI.h>
|
||||
|
||||
|
||||
|
||||
// secconfig.h Configures RF Module, TTN Keys / RF Networks and used Sensor
|
||||
#include "secconfig.h"
|
||||
|
||||
|
@ -41,6 +42,7 @@
|
|||
#ifdef RF_LORA
|
||||
// Include LoRaWAN
|
||||
#include <LoRaWAN.h>
|
||||
#include <EEPROM.h> // For Storing Frame Counter
|
||||
#define DIO0 PIN_B0
|
||||
#define NSS PIN_B1
|
||||
RFM95 rfm(DIO0,NSS);
|
||||
|
|
Loading…
Reference in a new issue