From 989dfbb92c7e548ca5a8178cb12f24f41338866b Mon Sep 17 00:00:00 2001 From: Egor Shitikov Date: Fri, 2 Aug 2024 19:46:12 -0700 Subject: [PATCH] add RSSI spectrum method --- src/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 931e943..ab12702 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -606,7 +606,7 @@ void loop() // wait for spectral scan to finish while (radio.spectralScanGetStatus() != RADIOLIB_ERR_NONE) { - // TODO: offload logic here it is non blocking spectral scan + Serial.println("radio.spectralScanGetStatus ERROR"); heltec_delay(1); } // read the results Array to which the results will be saved @@ -648,8 +648,8 @@ void loop() Serial.println(rssi); Serial.println(result_index); } - // Saving max value only - if (result[result_index] < rssi) + // Saving max value only rss is negative so smaller is bigger + if (result[result_index] > rssi) { result[result_index] = rssi; } @@ -739,7 +739,7 @@ void loop() detected = true; } - // Draw detection Level line + // Draw detection Level line evere 2 pixel if (y == drone_detection_level && x % 2 == 0) { display.setPixel(x, y); @@ -823,7 +823,8 @@ void loop() } } // wait a little bit before the next scan, otherwise the SX1262 hangs - heltec_delay(1); + // Add more logic before insead of delay... + // heltec_delay(1); } w++; if (w > STATUS_TEXT_TOP + 1)