AbleButtons V0.4.0
Lightweight button library for Arduino.
 
Loading...
Searching...
No Matches
DebouncableAny.ino File Reference

Example toggle control from multiple buttons. More...

#include <AbleButtons.h>

Go to the source code of this file.

Macros

#define BUTTON_A_PIN   2
 Connect button between this pin and ground. More...
 
#define BUTTON_B_PIN   3
 Connect button between this pin and ground. More...
 

Typedefs

using Button = AblePullupClickerButton
 Using clicker pull-up button. More...
 
using ButtonList = AblePullupClickerButtonList
 Using clicker pull-up button list. More...
 

Functions

void setup ()
 Setup the DebouncableAny example. More...
 
void loop ()
 Control the DebouncableAny example. More...
 

Variables

Button btnA (BUTTON_A_PIN)
 Primary button.
 
Button btnB (BUTTON_B_PIN)
 Secondary button.
 
bool led = false
 On/off state of the LED. More...
 
Buttonbtns []
 Array of buttons for ButtonList. More...
 
ButtonList btnList (btns)
 List of button to control together.
 

Detailed Description

Example toggle control from multiple buttons.

If any button in the list is clicked, the built-in LED will toggle on/off.

Definition in file DebouncableAny.ino.

Macro Definition Documentation

◆ BUTTON_A_PIN

#define BUTTON_A_PIN   2

Connect button between this pin and ground.

Definition at line 13 of file DebouncableAny.ino.

◆ BUTTON_B_PIN

#define BUTTON_B_PIN   3

Connect button between this pin and ground.

Definition at line 14 of file DebouncableAny.ino.

Typedef Documentation

◆ Button

Using clicker pull-up button.

Definition at line 10 of file DebouncableAny.ino.

◆ ButtonList

Using clicker pull-up button list.

Definition at line 11 of file DebouncableAny.ino.

Function Documentation

◆ loop()

void loop ( )

Control the DebouncableAny example.

Called repeatedly in a loop.

Definition at line 38 of file DebouncableAny.ino.

◆ setup()

void setup ( )

Setup the DebouncableAny example.

Called once to initialise everything.

Definition at line 30 of file DebouncableAny.ino.

Variable Documentation

◆ btns

Button* btns[]
Initial value:
= {
&btnA,
}
Button btnA(BUTTON_A_PIN)
Primary button.
Button btnB(BUTTON_B_PIN)
Secondary button.

Array of buttons for ButtonList.

Array of buttons A and B.

Definition at line 21 of file DebouncableAny.ino.

◆ led

bool led = false

On/off state of the LED.

Definition at line 18 of file DebouncableAny.ino.