From 422b8edd60c5e193fd8b238c19ba7e7ab5414cfa Mon Sep 17 00:00:00 2001 From: rkcf Date: Wed, 8 Feb 2023 12:16:11 -0600 Subject: [PATCH] Fix: change limits and pins --- main/esp32_rgb_rotary_encoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/esp32_rgb_rotary_encoder.c b/main/esp32_rgb_rotary_encoder.c index c80c3c2..75d763d 100644 --- a/main/esp32_rgb_rotary_encoder.c +++ b/main/esp32_rgb_rotary_encoder.c @@ -11,12 +11,12 @@ #include "hal/pcnt_types.h" /* Pinouts */ -#define PCNT_A_PIN 1 /* Rotary Encoder A Pin */ -#define PCNT_B_PIN 2 /* Rotary Encoder B Pin */ +#define PCNT_A_PIN 5 /* Rotary Encoder A Pin */ +#define PCNT_B_PIN 4 /* Rotary Encoder B Pin */ /* Pulse Count Settings */ #define PCNT_HIGH_LIMIT 100 /* 100 total steps */ -#define PCNT_LOW_LIMIT -1 +#define PCNT_LOW_LIMIT -100 static QueueHandle_t pcnt_queue = NULL; @@ -72,7 +72,7 @@ void app_main(void){ /* Install watch points */ ESP_LOGI(TAG, "Installing watch points and callback handler"); - int watch_points[] = {PCNT_LOW_LIMIT, 1, PCNT_HIGH_LIMIT}; + int watch_points[] = {-10, 10}; for (size_t i = 0; i < sizeof(watch_points) / sizeof(watch_points[0]); i++) { ESP_ERROR_CHECK(pcnt_unit_add_watch_point(pcnt_unit, watch_points[i])); }