From 360643aa3a2e930b783cf3a1c58141db7b2dfcb6 Mon Sep 17 00:00:00 2001 From: Egor Shitikov Date: Mon, 12 Aug 2024 10:38:58 -0700 Subject: [PATCH] add inverese fix --- src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f43c638..dfae3c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -561,11 +561,15 @@ void loop(void) // ------------------------------------------------------------- // Draw "Detection Level line" every 2 pixel // ------------------------------------------------------------- - if ((y == drone_detection_level) && (x % 2 == 0) && x < STEPS) + if ((y == drone_detection_level) && (dispaly_x % 2 == 0)) { - display.setColor(INVERSE); - display.setPixel((int)x, y); - display.setPixel((int)x, y + 1); // 2 px wide + display.setColor(WHITE); + if (filtered_result[y] == 1 && filtered_result[y + 1] == 1) + { + display.setColor(INVERSE); + } + display.setPixel(dispaly_x, y); + display.setPixel(dispaly_x, y + 1); // 2 px wide display.setColor(WHITE); } }