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

Test the Arduino Button Library Extension (ABLE). More...

#include "Config.h"
#include "Checks.h"
#include "Utils.h"
#include "Callback.h"

Go to the source code of this file.

Functions

void setup ()
 Setup the PushBtn example. More...
 
void loop ()
 Control TestAbleButton. More...
 

Variables

Button btnA (BUTTON_A_PIN, onEvent)
 Button A.
 
Button btnB (BUTTON_B_PIN, onEvent)
 Button B.
 
Buttonbtns [NUM_BUTTONS]
 Array of buttons for ButtonList. More...
 
ButtonList btnList (btns)
 List of buttons.
 
bool led = false
 State of the builtin LED. More...
 

Detailed Description

Test the Arduino Button Library Extension (ABLE).

This program will periodically output "Looking OK..." to the Serial port. As you press buttons connected to pins 2 and 3 it will assert the button settings in the callback fuctions and in the main loop.

The TestAbleButton program is split (by design) into multiple files to ensure AbleButtons works in multi-module programs. A common Config.h header file declares common elements shared across these modules.

Definition in file TestAbleButton.ino.

Function Documentation

◆ loop()

void loop ( )

Control TestAbleButton.

Called repeatedly in a loop.

< Timer to preiodically print OK message.

Definition at line 74 of file TestAbleButton.ino.

◆ setup()

void setup ( )

Setup the PushBtn example.

Called once to initialise everything.

Definition at line 37 of file TestAbleButton.ino.

Variable Documentation

◆ btns

Initial value:
= {
&btnA,
}
Button btnB(BUTTON_B_PIN, onEvent)
Button B.
Button btnA(BUTTON_A_PIN, onEvent)
Button A.

Array of buttons for ButtonList.

Array of buttons A and B.

Definition at line 27 of file TestAbleButton.ino.

◆ led

bool led = false

State of the builtin LED.

Definition at line 32 of file TestAbleButton.ino.