Simple brushless DC motor (ESC) driver using Servo library for Arduino/ESP32.
More...
template<typename T = float>
class tinyrobotics::BrushlessMotor< T >
Simple brushless DC motor (ESC) driver using Servo library for Arduino/ESP32.
This class provides an interface to control brushless DC motors (with ESCs) using the Servo or ESP32Servo library. It allows attaching to a pin, setting speed as a percentage, and detaching the servo.
Main methods:
- setPin(pin): Defines the pin to which the ESC control signal is connected.
- begin(): Initialize and attach the servo to the configured pin.
- setSpeed(percent): Set the motor speed as a percentage (0 to 100).
- end(): Stop the motor and detach the servo.
Usage notes:
- Call setPin() before begin().
- Use setSpeed() to control the motor speed. Use end() to stop and detach.
- The class maps speed percentage to servo pulse width (1000-2000us typical for ESCs).
Example usage:
motor.begin();
motor.setSpeed(50);
motor.end();
Simple brushless DC motor (ESC) driver using Servo library for Arduino/ESP32.
Definition: BrushlessMotor.h:48
void setPin(int pin)
Definition: BrushlessMotor.h:53