pure encoder test working on pins d5 and d6

This commit is contained in:
2025-12-28 12:46:09 -06:00
parent 456e3dcfd3
commit 9c64f91bcc

View File

@@ -6,6 +6,7 @@
#include "WiFi.hpp" #include "WiFi.hpp"
#include "setup.hpp" #include "setup.hpp"
#include "socketIO.hpp" #include "socketIO.hpp"
#include "encoder.hpp"
extern "C" void app_main() { extern "C" void app_main() {
printf("Hello "); printf("Hello ");
@@ -38,4 +39,23 @@ extern "C" void app_main() {
vTaskDelay(pdMS_TO_TICKS(1000)); vTaskDelay(pdMS_TO_TICKS(1000));
printf("loop\n"); 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();
} }