have added on sketch in the examples folder with dc motor and servo motor working and espnow

This commit is contained in:
ghassan committed 2025-03-24 12:43:57 +03:00
1 parent 7ae4d9ae5e
commit affdfdf602
4 files changed
+291 -12

No files matched your search

+13 -12
View File
@@ -3,23 +3,24 @@
#define Servo_ESP32_h
#include <Arduino.h>
#include <ESP32Servo.h>
class Servo_ESP32 {
private:
uint8_t servoPin;
uint8_t pwmChannel;
int minPulseWidth;
int maxPulseWidth;
int currentAngle;
const int freq = 50; // 50Hz for standard servos
const int resolution = 16; // 16-bit resolution for smoother control
bool _invert = false;
uint8_t _min_pos = 0;
uint8_t _max_pos = 180;
uint8_t _init_pos = 90;
uint8_t _prv_pos = 0;
uint8_t servoPin;
uint8_t pwmChannel;
int minPulseWidth;
int maxPulseWidth;
int currentAngle;
const int freq = 50; // 50Hz for standard servos
const int resolution = 16; // 16-bit resolution for smoother control
bool _invert = false;
uint8_t _min_pos = 0;
uint8_t _max_pos = 180;
uint8_t _init_pos = 90;
uint8_t _prv_pos = 0;
bool verify(uint8_t input) {
if (input != _prv_pos) {