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

Example toggle control from an Able button. More...

#include <AbleButtons.h>

Go to the source code of this file.

Macros

#define BUTTON_PIN   2
 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 Debouncable example. More...
 
void loop ()
 Control the Debouncable example. More...
 

Variables

Button btn (BUTTON_PIN)
 The button to check.
 
bool led = false
 On/off state of the LED. More...
 

Detailed Description

Example toggle control from an Able button.

This shows how Able can be used to create the same program as the built-in Debounce example included with the Arduino IDE.

The built-in LED toggles on/off when a button connected between pin 2 and ground is clicked (pressed, then released). It uses the internal pull-up resistor within an Arduino for the simplest button connection.

Definition in file Debouncable.ino.

Macro Definition Documentation

◆ BUTTON_PIN

#define BUTTON_PIN   2

Connect button between this pin and ground.

Definition at line 20 of file Debouncable.ino.

Typedef Documentation

◆ Button

Using clicker pull-up button.

Definition at line 17 of file Debouncable.ino.

◆ ButtonList

Using clicker pull-up button list.

Definition at line 18 of file Debouncable.ino.

Function Documentation

◆ loop()

void loop ( )

Control the Debouncable example.

Called repeatedly in a loop.

Definition at line 35 of file Debouncable.ino.

◆ setup()

void setup ( )

Setup the Debouncable example.

Called once to initialise everything.

Definition at line 27 of file Debouncable.ino.

Variable Documentation

◆ led

bool led = false

On/off state of the LED.

Definition at line 22 of file Debouncable.ino.