Open mister-Monk opened 1 week ago
This is what I did:
Added a copy OneButton::OneButton to the library
void initOB(const int pin, const boolean activeLow = true, const bool pullupActive = true);
void OneButton::initOB(const int pin, const boolean activeLow, const bool pullupActive) { // OneButton(); _pin = pin;
if (activeLow) { // the button connects the input pin to GND when pressed. _buttonPressed = LOW; ...
Further
OneButton button1;
void setup() { File _file = SPIFFS.open ... BUTTON_pin = r_c.toInt(); ... button1.initOB(BUTTON_pin, true, true); }
It works. But I'm not sure if this is the right way.
I want to use the GPIO number obtained from SPIFFS in OneButton. Something like this:
include
include
void setup() { File _file = SPIFFS.open ... BUTTON_pin = r_c.toInt(); ... OneButton button1(BUTTON_pin, true, true); }
Is this possible? How?