ESP32_EasyKit is a high-performance C++17 library for the ESP32 series that leverages native silicon features (MCPWM and LEDC) to provide rock-solid, hardware-locked control for robots, lighting, and RC applications.
- ⚡ Hardware-Locked Stability: Uses dedicated MCPWM units for sub-microsecond pulse precision with zero CPU jitter.
- 🤖 Organic Motion: Advanced Asymmetric Sigmoid easing and Momentum Hand-off ensure professional, jerk-free movements for servos.
- 🏎️ Low Latency: Direct-drive motor control with hardware-enforced dead-time for high-performance control loops.
- 💎 FPU Optimized: Designed from the ground up for the ESP32 hardware Floating Point Unit.
#include <ESP32_EasyKit.h>
Servo myServo;
EasyMotor myMotor;
EasyLED myLED(6);
void setup() {
myServo.attach(18);
myMotor.begin(7, 8);
// Asymmetric move: Go to 90°, rapid start, soft finish (0.2 in, 0.8 out)
myServo.write(90.0f, 60.0f, 0.2f, 0.8f);
// Instant motor control (Direct-Drive)
myMotor.write(100.0f);
}
void loop() {
myServo.update(); // Process servo animation
myLED.update(); // Process LED fading/blinking
}For a deep dive into the library architecture and performance tuning, start with the General Guide.
- 📑 Servo Functions: Precise motion with asymmetric easing and multi-pin support.
- 📑 Motor Functions: Low-latency direct-drive control.
- 📑 LED & PWM Functions: Flicker-free transitions and patterns.
- 📑 EasyLEDGroup: Coordinated multi-LED step sequencing (
alternate,syncFlash,chase,doubleStrobe).
EasyLED ditchL(4), ditchR(5);
EasyLEDGroup ditchGroup({&ditchL, &ditchR});
void setup() {
ditchGroup.alternate(16); // Alternate ditch lights every 16ms
}
void loop() {
ditchGroup.update();
}To maximize performance, always use the f suffix for decimal constants:
myServo.write(90.0f, 60.0f, 0.5f, 0.5f); // Hardware FPU (Fast)
myServo.write(90.0, 60.0, 0.5, 0.5); // Software Emulation (Slow)For more details on forcing FPU safety with compiler flags, see the Optimization Guide.
Licensed under the MIT License.