AbleButtons V0.2.0
Lightweight button library for Arduino.
 
Loading...
Searching...
No Matches
TestAbleButton.h File Reference

Declarations for the TestAbleButton program. More...

#include <AbleButtons.h>
#include "Config.h"

Go to the source code of this file.

Classes

struct  ButtonState
 

Macros

#define BUTTON_A_PIN   2
 Connect button between this pin and ground. More...
 
#define BUTTON_B_PIN   3
 Connect button using pulldown resistor circuit. More...
 

Typedefs

using Button = TESTABLE_USING_BUTTON
 Using the button defined by the circuit, callback and class. More...
 
using ButtonList = TESTABLE_USING_BUTTONLIST
 Using the button list defined by the circuit, callback and class. More...
 

Functions

void onEvent (Button::CALLBACK_EVENT, uint8_t)
 Callback function for button events. More...
 
void onPressed (Button *)
 Callback function for button pressed. More...
 
void onReleased (Button *)
 Callback function for button released. More...
 
void onHeld (Button *)
 Callback function for button held. More...
 
void onIdle (Button *)
 Callback function for button idle. More...
 
void checkButtonSetup (Button *btn)
 
void checkButtonJustPressed (Button *btn)
 Check state of a pressed button... More...
 
void checkButtonJustReleased (Button *btn)
 Check button that has just been released. More...
 
void checkButtonJustHeld (Button *btn)
 Check button that has just been held. More...
 
void checkButtonJustIdle (Button *btn)
 Check button that has just become idle. More...
 
void checkButtonJustClicked (Button *btn)
 Check button that has just been clicked. More...
 
void checkButtonJustDoubleClicked (Button *btn)
 Check button that has just been double-clicked. More...
 
void checkButtonIntegrity (Button *btn, ButtonState &state)
 Check integrity of Button invariants (always hold true). More...
 
void displayButton (Button *btn, ButtonState &state, int index)
 
void checkButtonListSetup ()
 Check initial setup of the button list. More...
 
void checkButtonListJustPressed (Button *btnPressed)
 Check ButtonList when button just pressed. More...
 
void checkButtonListJustReleased (Button *btnReleased)
 Check ButtonList when button just released. More...
 
void checkButtonListJustHeld (Button *btn)
 Check ButtonList when button just held. More...
 
void checkButtonListJustIdle (Button *btn)
 Check ButtonList when button just idle. More...
 
void checkButtonListJustClicked (Button *btn)
 Check ButtonList when button just clicked. More...
 
void checkButtonListJustDoubleClicked (Button *btn)
 Check ButtonList when button just double-clicked. More...
 
void checkButtonListIntegrity ()
 Check integrity of ButtonList invariants (always hold true). More...
 

Variables

Button btnA
 Button A.
 
Button btnB
 Button B.
 
Buttonbtns []
 Array of buttons A and B. More...
 
ButtonList btnList
 Declaration of button list.
 
ButtonpressedBtn
 Button pressed event. More...
 
ButtonreleasedBtn
 Button released event. More...
 

Detailed Description

Declarations for the TestAbleButton program.

Included by all the modules to share program information.

Definition in file TestAbleButton.h.

Macro Definition Documentation

◆ BUTTON_A_PIN

#define BUTTON_A_PIN   2

Connect button between this pin and ground.

Definition at line 14 of file TestAbleButton.h.

◆ BUTTON_B_PIN

#define BUTTON_B_PIN   3

Connect button using pulldown resistor circuit.

Definition at line 15 of file TestAbleButton.h.

Typedef Documentation

◆ Button

Using the button defined by the circuit, callback and class.

Definition at line 11 of file TestAbleButton.h.

◆ ButtonList

Using the button list defined by the circuit, callback and class.

Definition at line 12 of file TestAbleButton.h.

Function Documentation

◆ checkButtonIntegrity()

void checkButtonIntegrity ( Button btn,
ButtonState state 
)

Check integrity of Button invariants (always hold true).

Definition at line 121 of file CheckButton.cpp.

◆ checkButtonJustClicked()

void checkButtonJustClicked ( Button btn)

Check button that has just been clicked.

Definition at line 89 of file CheckButton.cpp.

◆ checkButtonJustDoubleClicked()

void checkButtonJustDoubleClicked ( Button btn)

Check button that has just been double-clicked.

Definition at line 105 of file CheckButton.cpp.

◆ checkButtonJustHeld()

void checkButtonJustHeld ( Button btn)

Check button that has just been held.

Definition at line 57 of file CheckButton.cpp.

◆ checkButtonJustIdle()

void checkButtonJustIdle ( Button btn)

Check button that has just become idle.

Definition at line 73 of file CheckButton.cpp.

◆ checkButtonJustPressed()

void checkButtonJustPressed ( Button btn)

Check state of a pressed button...

Definition at line 25 of file CheckButton.cpp.

◆ checkButtonJustReleased()

void checkButtonJustReleased ( Button btn)

Check button that has just been released.

Definition at line 41 of file CheckButton.cpp.

◆ checkButtonListIntegrity()

void checkButtonListIntegrity ( )

Check integrity of ButtonList invariants (always hold true).

Definition at line 111 of file CheckList.cpp.

◆ checkButtonListJustClicked()

void checkButtonListJustClicked ( Button btn)

Check ButtonList when button just clicked.

Definition at line 97 of file CheckList.cpp.

◆ checkButtonListJustDoubleClicked()

void checkButtonListJustDoubleClicked ( Button btn)

Check ButtonList when button just double-clicked.

Definition at line 104 of file CheckList.cpp.

◆ checkButtonListJustHeld()

void checkButtonListJustHeld ( Button btn)

Check ButtonList when button just held.

Definition at line 83 of file CheckList.cpp.

◆ checkButtonListJustIdle()

void checkButtonListJustIdle ( Button btn)

Check ButtonList when button just idle.

Definition at line 90 of file CheckList.cpp.

◆ checkButtonListJustPressed()

void checkButtonListJustPressed ( Button btnPressed)

Check ButtonList when button just pressed.

Definition at line 38 of file CheckList.cpp.

◆ checkButtonListJustReleased()

void checkButtonListJustReleased ( Button btnReleased)

Check ButtonList when button just released.

Definition at line 63 of file CheckList.cpp.

◆ checkButtonListSetup()

void checkButtonListSetup ( )

Check initial setup of the button list.

Definition at line 12 of file CheckList.cpp.

◆ checkButtonSetup()

void checkButtonSetup ( Button btn)

Definition at line 9 of file CheckButton.cpp.

◆ displayButton()

void displayButton ( Button btn,
ButtonState state,
int  index 
)

Definition at line 180 of file CheckButton.cpp.

◆ onEvent()

void onEvent ( Button::CALLBACK_EVENT  event,
uint8_t  id 
)

Callback function for button events.

Parameters
eventThe event that has occured.
idThe identifier of the button generating the callback.

Definition at line 23 of file Callback.cpp.

◆ onHeld()

void onHeld ( Button btn)

Callback function for button held.

Parameters
btnThe button generaing the event.

Definition at line 36 of file Pressed.cpp.

◆ onIdle()

void onIdle ( Button btn)

Callback function for button idle.

Parameters
btnThe button generaing the event.

Definition at line 36 of file Released.cpp.

◆ onPressed()

void onPressed ( Button btn)

Callback function for button pressed.

Parameters
btnThe button generaing the event.

Definition at line 18 of file Pressed.cpp.

◆ onReleased()

void onReleased ( Button btn)

Callback function for button released.

Parameters
btnThe button generaing the event.

Definition at line 18 of file Released.cpp.

Variable Documentation

◆ btns

Button* btns[]
extern

Array of buttons A and B.

Array of buttons A and B.

Definition at line 21 of file ButtonableAll.ino.

◆ pressedBtn

Button* pressedBtn
extern

Button pressed event.

Button pressed event.

Definition at line 11 of file Pressed.cpp.

◆ releasedBtn

Button* releasedBtn
extern

Button released event.

Button released event.

Definition at line 11 of file Released.cpp.