VizBlocks
Public Member Functions | Static Public Attributes | List of all members
Button Class Reference

#include <Button.h>

Public Member Functions

 Button (int pin, int id=99)
 
void initInterrupts (void(*function)())
 
void setEventHandler (void(*function)(Button *, uint8_t, bool))
 
bool getState ()
 
int getId ()
 
int getClickInterval ()
 
int getHoldInterval ()
 
int getRepeatInterval ()
 
void check ()
 
void ICACHE_RAM_ATTR tick ()
 

Static Public Attributes

static const uint8_t kEventPressed = 0
 
static const uint8_t kEventReleased = 1
 
static const uint8_t kEventClicked = 2
 
static const uint8_t kEventHeld = 3
 
static const uint8_t kEventTick = 4
 

Constructor & Destructor Documentation

◆ Button()

Button::Button ( int  pin,
int  id = 99 
)
inline

Member Function Documentation

◆ check()

void Button::check ( )
inline

◆ getClickInterval()

int Button::getClickInterval ( )
inline

◆ getHoldInterval()

int Button::getHoldInterval ( )
inline

◆ getId()

int Button::getId ( )
inline

◆ getRepeatInterval()

int Button::getRepeatInterval ( )
inline

◆ getState()

bool Button::getState ( )
inline

◆ initInterrupts()

void Button::initInterrupts ( void(*)()  function)
inline

◆ setEventHandler()

void Button::setEventHandler ( void(*)(Button *, uint8_t, bool)  function)
inline

◆ tick()

void ICACHE_RAM_ATTR Button::tick ( )
inline

Member Data Documentation

◆ kEventClicked

const uint8_t Button::kEventClicked = 2
static

◆ kEventHeld

const uint8_t Button::kEventHeld = 3
static

◆ kEventPressed

const uint8_t Button::kEventPressed = 0
static

◆ kEventReleased

const uint8_t Button::kEventReleased = 1
static

◆ kEventTick

const uint8_t Button::kEventTick = 4
static

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