You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
hi i have not much experience programming but i wrote a class for multibutton. would that be appreciated?
it registers fastpress and counts how many there are and returns that, and it counts up if you hold the button down. every 0.5s it adds 1.
#include "Multi_Button.h"
#define BUTTON_PIN D3 // Button Pin on node mcu it is D3
#define TIME_GAP_SHORT 300 // Set the time between fast presses
#define TIME_GAP_LONG 500 // Set the time between long presses
#define BUTTON_STATE 0// Set the button to 1 HIGH on or 0 LOW on
if(uint8_t counts = Button1.ShortPress())
{
if (counts == 1) your code here;
if(counts == 2) your code here;
if(counts == 3) your code here;
if(counts == 4) your code here;
}
//or the long press
if (uint8_t counts = Button1.LongPress())
{
if (counts == 1) your code here;
if(counts == 2) your code here;
if(counts == 3) your code here;
if(counts == 4) your code here;
}
Button1.fast_press_toggle; // true or false is the debounced toggle of the specified button
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Multiple buttons (or any form of GPIO input) that would feed back to MQTT, so as to trigger automations.
The text was updated successfully, but these errors were encountered: