Fix: change limits and pins

main
rkcf 2023-02-08 12:16:11 -06:00
parent 8f1add76b8
commit 422b8edd60
1 changed files with 4 additions and 4 deletions

View File

@ -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]));
}