From c573254d0666b3205ed86427472b22f1ccbc31a5 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Tue, 2 Mar 2021 18:32:56 +0100 Subject: [PATCH] Reduce LED Brightness --- src/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 83b186a..8c28646 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -192,10 +192,14 @@ void do_send(osjob_t* j) { #ifndef HAS_NO_SENSOR sensor.getSensorData(data); - // ppm_level - // 0 -> < 1000 ppm green - // 1 -> < 1800 ppm yellow - // 2 -> > 1000 ppm red + // Queue Packet for Sending + DEBUG_PRINTLN("LoRa-Packet Queued"); + LMIC_setTxData2(1, (unsigned char *)&data, sizeof(data), 0); + + // ppm level + // < 1000 ppm green + // < 1800 ppm yellow + // > 1000 ppm red if (data.ppm > 0 && data.ppm <= 1000) { leds.setPixelColor(0, leds.Color(0,127,0)); @@ -212,9 +216,7 @@ void do_send(osjob_t* j) { } #endif - // Queue Packet for Sending - DEBUG_PRINTLN("LoRa-Packet Queued"); - LMIC_setTxData2(1, (unsigned char *)&data, sizeof(data), 0); + } } @@ -228,7 +230,7 @@ void setup() SPI.begin(); pinMode(PIN_PC1, OUTPUT); - leds.setBrightness(127); + leds.setBrightness(64); // Disable unused Pins (for power saving) for (int i = 0; i < (sizeof(disabledPins) / sizeof(disabledPins[0])) - 1; i++)