From 9c64f91bccda945d062a26b7e8a1c2c9cddaa845 Mon Sep 17 00:00:00 2001 From: pulipakaa24 Date: Sun, 28 Dec 2025 12:46:09 -0600 Subject: [PATCH] pure encoder test working on pins d5 and d6 --- src/main.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index e421538..fdc94a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include "WiFi.hpp" #include "setup.hpp" #include "socketIO.hpp" +#include "encoder.hpp" extern "C" void app_main() { printf("Hello "); @@ -38,4 +39,23 @@ extern "C" void app_main() { vTaskDelay(pdMS_TO_TICKS(1000)); printf("loop\n"); } +} + +void encoderTest() { + encoder_init(); + + int32_t prevCount = encoder_count; + + while (1) { + if (encoder_count != prevCount) { + prevCount = encoder_count; + printf("Encoder Pos: %d\n", prevCount); + } + vTaskDelay(pdMS_TO_TICKS(100)); + } +} + +extern "C" void app_main() { + // mainApp(); + encoderTest(); } \ No newline at end of file