Parking Garage Control System
ESP32 Parking Garage – ESP-IDF/FreeRTOS
Loading...
Searching...
No Matches
EspServoOutput Class Reference

ESP32 implementation of servo control via PWM. More...

#include <EspServoOutput.h>

Inheritance diagram for EspServoOutput:
Collaboration diagram for EspServoOutput:

Public Member Functions

 EspServoOutput (gpio_num_t pin, ledc_channel_t ledcChannel, bool initialLevel=false)
 Construct ESP32 Servo output.
 
 ~EspServoOutput () override
 
 EspServoOutput (const EspServoOutput &)=delete
 
EspServoOutput & operator= (const EspServoOutput &)=delete
 
void setLevel (bool high) override
 Set GPIO output level.
 
bool getLevel () const override
 Get current GPIO output level.
 
- Public Member Functions inherited from IGpioOutput
virtual ~IGpioOutput ()=default
 
virtual ~IGpioOutput ()=default
 

Detailed Description

ESP32 implementation of servo control via PWM.

Controls a servo motor using LEDC PWM.

  • LOW (false) = Servo at 90° (barrier closed - vertical)
  • HIGH (true) = Servo at 0° (barrier open - horizontal)

Constructor & Destructor Documentation

◆ EspServoOutput() [1/2]

EspServoOutput::EspServoOutput ( gpio_num_t  pin,
ledc_channel_t  ledcChannel,
bool  initialLevel = false 
)
explicit

Construct ESP32 Servo output.

Parameters
pinGPIO pin number
ledcChannelLEDC channel to use (0-7)
initialLevelInitial position (false=closed, true=open)

◆ ~EspServoOutput()

EspServoOutput::~EspServoOutput ( )
override

◆ EspServoOutput() [2/2]

EspServoOutput::EspServoOutput ( const EspServoOutput &  )
delete

Member Function Documentation

◆ getLevel()

bool EspServoOutput::getLevel ( ) const
overridevirtual

Get current GPIO output level.

Returns
true if HIGH, false if LOW

Implements IGpioOutput.

◆ operator=()

EspServoOutput & EspServoOutput::operator= ( const EspServoOutput &  )
delete

◆ setLevel()

void EspServoOutput::setLevel ( bool  high)
overridevirtual

Set GPIO output level.

Parameters
hightrue for HIGH, false for LOW

Implements IGpioOutput.


The documentation for this class was generated from the following files:
Coverage