RBE1001Lib
Public Member Functions | Private Types | Private Attributes
Button Class Reference

#include <button.h>

Public Member Functions

 Button (uint8_t pin, uint32_t db=10)
 
void Init (bool usePullup=true)
 
bool CheckButtonPress (void)
 

Private Types

enum  BUTTON_STATE { BUTTON_STABLE, BUTTON_UNSTABLE }
 

Private Attributes

BUTTON_STATE state = BUTTON_STABLE
 
uint8_t buttonPin = -1
 
uint8_t activeState = LOW
 
uint8_t stabButtonPos = HIGH
 
uint8_t tempButtonPos = HIGH
 
uint32_t lastBounceTime = 0
 
uint32_t debouncePeriod = 10
 

Detailed Description

Definition at line 18 of file button.h.

Member Enumeration Documentation

◆ BUTTON_STATE

enum Button::BUTTON_STATE
private
Enumerator
BUTTON_STABLE 
BUTTON_UNSTABLE 

Definition at line 21 of file button.h.

Constructor & Destructor Documentation

◆ Button()

Button::Button ( uint8_t  pin,
uint32_t  db = 10 
)

Definition at line 3 of file button.cpp.

References buttonPin, debouncePeriod, and pin.

Member Function Documentation

◆ CheckButtonPress()

bool Button::CheckButtonPress ( void  )

◆ Init()

void Button::Init ( bool  usePullup = true)

Definition at line 9 of file button.cpp.

References buttonPin, stabButtonPos, and tempButtonPos.

Field Documentation

◆ activeState

uint8_t Button::activeState = LOW
private

Definition at line 25 of file button.h.

Referenced by CheckButtonPress().

◆ buttonPin

uint8_t Button::buttonPin = -1
private

Definition at line 24 of file button.h.

Referenced by Button(), CheckButtonPress(), and Init().

◆ debouncePeriod

uint32_t Button::debouncePeriod = 10
private

Definition at line 31 of file button.h.

Referenced by Button(), and CheckButtonPress().

◆ lastBounceTime

uint32_t Button::lastBounceTime = 0
private

Definition at line 30 of file button.h.

Referenced by CheckButtonPress().

◆ stabButtonPos

uint8_t Button::stabButtonPos = HIGH
private

Definition at line 27 of file button.h.

Referenced by CheckButtonPress(), and Init().

◆ state

BUTTON_STATE Button::state = BUTTON_STABLE
private

Definition at line 22 of file button.h.

Referenced by CheckButtonPress().

◆ tempButtonPos

uint8_t Button::tempButtonPos = HIGH
private

Definition at line 28 of file button.h.

Referenced by CheckButtonPress(), and Init().


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