Added basically all servo logic with encoders. Need to test.

This commit is contained in:
2025-12-31 15:44:48 -06:00
parent b43c918c57
commit 90e967c6f8
15 changed files with 3205 additions and 222 deletions

View File

@@ -1,6 +1,7 @@
#ifndef DEFINES_H
#define DEFINES_H
#include "driver/gpio.h"
#include "driver/ledc.h"
#define ccwSpeed 6500
#define cwSpeed 3300
@@ -19,15 +20,22 @@
#define tokenTag "TOKEN"
#define nvsCalib "CALIB"
#define UpMinusDownTicksTag "UPDOWN"
#define UpTicksTag "UP"
#define DownTicksTag "DOWN"
#define statusTag "STATUS"
#define nvsServo "SERVO"
#define posTag "POS"
#define ENCODER_PIN_A GPIO_NUM_23
#define ENCODER_PIN_B GPIO_NUM_16
#define InputEnc_PIN_A GPIO_NUM_1
#define InputEnc_PIN_B GPIO_NUM_2
#define servoPin GPIO_NUM_20
#define servoLEDCChannel LEDC_CHANNEL_0
#define getMovingCW(port) ((movingCW & (1 << port)) >> port)
#define setMovingCW(port) (movingCW |= (1 << port))
#define clearMovingCW(port) (movingCW &= ~(1 << port))