AbleButtons V0.2.0
Lightweight button library for Arduino.
 
Loading...
Searching...
No Matches
ButtonableAll.ino File Reference

Example on/off 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 = AblePullupButton
 Using basic pull-up button. More...
 
using ButtonList = AblePullupButtonList
 Using basic pull-up button list. More...
 

Functions

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

Variables

Button btnA (BUTTON_A_PIN)
 Primary button.
 
Button btnB (BUTTON_B_PIN)
 Secondary button.
 
Buttonbtns []
 Array of buttons for ButtonList. More...
 
ButtonList btnList (btns)
 List of button to control together.
 

Detailed Description

Example on/off control from multiple buttons.

Only when all the button in the list are pressed will the built-in LED lights. Each button is connected to a subsequent pin.

Definition in file ButtonableAll.ino.

Macro Definition Documentation

◆ BUTTON_A_PIN

#define BUTTON_A_PIN   2

Connect button between this pin and ground.

Definition at line 14 of file ButtonableAll.ino.

◆ BUTTON_B_PIN

#define BUTTON_B_PIN   3

Connect button between this pin and ground.

Definition at line 15 of file ButtonableAll.ino.

Typedef Documentation

◆ Button

Using basic pull-up button.

Definition at line 11 of file ButtonableAll.ino.

◆ ButtonList

Using basic pull-up button list.

Definition at line 12 of file ButtonableAll.ino.

Function Documentation

◆ loop()

void loop ( )

Control the ButtonableAll example.

Called repeatedly in a loop.

Definition at line 38 of file ButtonableAll.ino.

◆ setup()

void setup ( )

Setup the ButtonableAll example.

Called once to initialise everything.

Definition at line 30 of file ButtonableAll.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 ButtonableAll.ino.