AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
ButtonController Class Reference

ESP32-specific implementation of IButtonController interface. More...

#include <button_controller.h>

Inheritance diagram for ButtonController:
IButtonController IButtonController

Public Member Functions

 ButtonController (uint8_t pin)
 Constructs a ButtonController for a specific GPIO pin.
 
virtual void setup () override
 Initializes the GPIO pin for button input.
 
virtual bool read () override
 Reads the current button state.
 
 ButtonController (uint8_t pin)
 Constructs a ButtonController for a specific pin.
 
void setup () override
 Initializes the pin as input with pull-up.
 
bool read () override
 Reads the current button state.
 
- Public Member Functions inherited from IButtonController
virtual ~IButtonController ()=default
 

Detailed Description

ESP32-specific implementation of IButtonController interface.

nRF52840-specific implementation of IButtonController interface

Concrete implementation that reads button state from a GPIO pin on the ESP32 microcontroller with pull-up resistor configuration.

Reads button state from a GPIO pin with pull-up resistor configuration.

Definition at line 13 of file esp32/include/button_controller.h.

Constructor & Destructor Documentation

◆ ButtonController() [1/2]

ButtonController::ButtonController ( uint8_t  pin)

Constructs a ButtonController for a specific GPIO pin.

Parameters
pinGPIO pin number to which the button is connected

Definition at line 8 of file esp32/src/button_controller.cpp.

◆ ButtonController() [2/2]

ButtonController::ButtonController ( uint8_t  pin)
explicit

Constructs a ButtonController for a specific pin.

Parameters
pinGPIO pin number to which the button is connected

Member Function Documentation

◆ read() [1/2]

bool ButtonController::read ( )
overridevirtual

Reads the current button state.

Returns
true if button is pressed (active low), false otherwise

Implements IButtonController.

Definition at line 26 of file esp32/src/button_controller.cpp.

◆ read() [2/2]

bool ButtonController::read ( )
overridevirtual

Reads the current button state.

Returns
true if button is pressed (active low)

Implements IButtonController.

◆ setup() [1/2]

void ButtonController::setup ( )
overridevirtual

Initializes the GPIO pin for button input.

Configures the pin as input with pull-up resistor.

Implements IButtonController.

Definition at line 15 of file esp32/src/button_controller.cpp.

◆ setup() [2/2]

void ButtonController::setup ( )
overridevirtual

Initializes the pin as input with pull-up.

Implements IButtonController.


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