AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
esp32/include/button.h
Go to the documentation of this file.
1
#pragma once
2
#include "
i_button.h
"
3
#include <Arduino.h>
4
13
class
Button
:
public
IButton
14
{
15
private
:
16
uint8_t PIN;
21
bool
isDebounced(
unsigned
long
now)
const
;
22
23
public
:
24
volatile
uint8_t
pressCount
= 0;
25
volatile
bool
awaitingRelease
=
false
;
26
unsigned
long
lastDebounceTime
= 0;
27
unsigned
long
debounceDelay
= 100;
33
explicit
Button
(uint8_t PIN);
34
40
void
setup
()
override
;
41
47
void
isr
();
48
53
bool
event
()
override
;
54
60
void
reset
()
override
;
61
};
Button
ESP32 interrupt-driven button with debouncing.
Definition
esp32/include/button.h:14
Button::setup
void setup() override
Configures the GPIO pin as input with pull-up.
Definition
esp32/src/button.cpp:9
Button::awaitingRelease
volatile bool awaitingRelease
True after press, until pin goes HIGH.
Definition
esp32/include/button.h:25
Button::pressCount
volatile uint8_t pressCount
Incremented by ISR, decremented by event()
Definition
esp32/include/button.h:24
Button::lastDebounceTime
unsigned long lastDebounceTime
Timestamp of last accepted press.
Definition
esp32/include/button.h:26
Button::isr
void isr()
ISR entry point — call from an IRAM_ATTR interrupt handler.
Definition
esp32/src/button.cpp:20
Button::debounceDelay
unsigned long debounceDelay
Debounce window in milliseconds.
Definition
esp32/include/button.h:27
Button::reset
void reset() override
Clears the pressed flag.
Definition
esp32/src/button.cpp:50
Button::event
bool event() override
Checks for a press event and clears the flag.
Definition
esp32/src/button.cpp:40
IButton
Interface for interrupt-driven button input.
Definition
i_button.h:12
i_button.h
lib
hardware
esp32
include
button.h
Generated by
1.9.8