21 #include "esp32-hal-ledc.h" 51 bool attachPin(uint8_t pin, uint32_t freq, uint8_t resolution);
54 bool setDuty(uint8_t pin, uint32_t duty);
56 uint32_t
tone(uint8_t pin, uint32_t freq);
High-level interface for the ESP32/ESP32-Sx/ESP32-Cx LED Control (LEDC) peripheral. Instead of specifying a timer or channel, this class automatically allocates a channel and associates it with a pin. Underlying esp32-hal-ledc performs timer management and handles the low-level LEDC peripheral API calls.
Definition: ws_ledc.h:37
~ws_ledc()
Dtor.
Definition: ws_ledc.h:50
bool analogWrite(uint8_t pin, int value)
Arduino AnalogWrite function, but for ESP32's LEDC.
Definition: ws_ledc.cpp:51
bool setDuty(uint8_t pin, uint32_t duty)
Sets the duty cycle of a LEDC pin.
Definition: ws_ledc.cpp:71
Class that provides storage and functions for the Adafruit IO Wippersnapper interface.
Definition: Wippersnapper.h:283
bool detachPin(uint8_t pin)
Detaches a pin from LEDC.
Definition: ws_ledc.cpp:41
ws_ledc()
Ctor.
Definition: ws_ledc.h:44
bool attachPin(uint8_t pin, uint32_t freq, uint8_t resolution)
Sets up a LEDC pin with given frequency and resolution.
Definition: ws_ledc.cpp:30
Wippersnapper WS
Definition: Wippersnapper.cpp:36
uint32_t tone(uint8_t pin, uint32_t freq)
Writes a square wave with a fixed duty cycle and variable frequency to a pin. Used by piezo buzzers a...
Definition: ws_ledc.cpp:85