Pokitto::Buttons Class Reference

Static Public Member Functions

static void initButtons ()
 
static void pollButtons ()
 
static uint8_t leftBtn ()
 
static uint8_t rightBtn ()
 
static uint8_t upBtn ()
 
static uint8_t downBtn ()
 
static uint8_t aBtn ()
 
static uint8_t bBtn ()
 
static uint8_t cBtn ()
 
static uint8_t leftHeld ()
 
static uint8_t rightHeld ()
 
static uint8_t upHeld ()
 
static uint8_t downHeld ()
 
static uint8_t aHeld ()
 
static uint8_t bHeld ()
 
static uint8_t cHeld ()
 
static uint8_t leftReleased ()
 
static uint8_t rightReleased ()
 
static uint8_t upReleased ()
 
static uint8_t downReleased ()
 
static uint8_t aReleased ()
 
static uint8_t bReleased ()
 
static uint8_t cReleased ()
 
static void begin ()
 
static void update ()
 
static bool pressed (uint8_t button)
 
static bool released (uint8_t button)
 
static bool held (uint8_t button, uint8_t time)
 
static bool repeat (uint8_t button, uint8_t period)
 
static uint8_t timeHeld (uint8_t button)
 

Static Public Attributes

static uint8_t buttons_state
 
static uint8_t buttons_held
 
static uint8_t buttons_released
 
static uint8_t pins [NUM_BTN]
 
static uint8_t states [NUM_BTN]
 
static uint8_t heldStates [NUM_BTN]
 

Member Function Documentation

◆ held()

bool Buttons::held ( uint8_t  button,
uint8_t  time 
)
static

returns true ONCE when 'button' is held for 'time' frames

Parameters
buttonThe button's ID
timeHow much frames button must be held, between 1 and 254.
Returns
true when 'button' is held for 'time' frames

◆ repeat()

bool Buttons::repeat ( uint8_t  button,
uint8_t  period 
)
static

returns true every 'period' frames when 'button' is held

Parameters
buttonThe button's ID
periodHow much frames button must be held, between 1 and 254.
Returns
true if the button is held for the given time

◆ timeHeld()

uint8_t Buttons::timeHeld ( uint8_t  button)
static
Parameters
buttonThe button's ID
Returns
The number of frames during which the button has been held.

◆ update()

void Buttons::update ( )
static

HARDWARE CODE


The documentation for this class was generated from the following files: