Fix: change limits and pins
parent
8f1add76b8
commit
422b8edd60
|
|
@ -11,12 +11,12 @@
|
||||||
#include "hal/pcnt_types.h"
|
#include "hal/pcnt_types.h"
|
||||||
|
|
||||||
/* Pinouts */
|
/* Pinouts */
|
||||||
#define PCNT_A_PIN 1 /* Rotary Encoder A Pin */
|
#define PCNT_A_PIN 5 /* Rotary Encoder A Pin */
|
||||||
#define PCNT_B_PIN 2 /* Rotary Encoder B Pin */
|
#define PCNT_B_PIN 4 /* Rotary Encoder B Pin */
|
||||||
|
|
||||||
/* Pulse Count Settings */
|
/* Pulse Count Settings */
|
||||||
#define PCNT_HIGH_LIMIT 100 /* 100 total steps */
|
#define PCNT_HIGH_LIMIT 100 /* 100 total steps */
|
||||||
#define PCNT_LOW_LIMIT -1
|
#define PCNT_LOW_LIMIT -100
|
||||||
|
|
||||||
static QueueHandle_t pcnt_queue = NULL;
|
static QueueHandle_t pcnt_queue = NULL;
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ void app_main(void){
|
||||||
|
|
||||||
/* Install watch points */
|
/* Install watch points */
|
||||||
ESP_LOGI(TAG, "Installing watch points and callback handler");
|
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++) {
|
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]));
|
ESP_ERROR_CHECK(pcnt_unit_add_watch_point(pcnt_unit, watch_points[i]));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue