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

Example on/off 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 = AblePullupDirectButton
 Using the direct pull-up button. More...
 
using ButtonList = AblePullupDirectButtonList
 Using the direct pull-up button list. More...
 

Functions

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

Variables

Button btn (BUTTON_PIN)
 The button to check.
 

Detailed Description

Example on/off control from an Able button.

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

The built-in LED lights when a button connected between pin 2 and ground is pressed. It uses the internal pull-up resistor within an Arduino for the simplest button connection.

NB: This example uses direct pin reading which is not debounced. Contact bouncing can make the button's signal unstable for a few ms when pressed or released.

Definition in file Buttonable.ino.

Macro Definition Documentation

◆ BUTTON_PIN

#define BUTTON_PIN   2

Connect button between this pin and ground.

Definition at line 24 of file Buttonable.ino.

Typedef Documentation

◆ Button

Using the direct pull-up button.

Definition at line 21 of file Buttonable.ino.

◆ ButtonList

Using the direct pull-up button list.

Definition at line 22 of file Buttonable.ino.

Function Documentation

◆ loop()

void loop ( )

Control the Buttonable example.

Called repeatedly in a loop.

Definition at line 38 of file Buttonable.ino.

◆ setup()

void setup ( )

Setup the Buttonable example.

Called once to initialise everything.

Definition at line 30 of file Buttonable.ino.