AceButton  1.0.0
An Adjustable Compact Event-driven (ACE) button library for Arduino.
Public Member Functions | List of all members
ace_button::testing::TestHelper Class Reference

A wrapper class that sends emulated button presses and released to the the underlying AceButton class, and captures the resulting events in the provided EventTracker. More...

#include <TestHelper.h>

Public Member Functions

 TestHelper (TestableButtonConfig *testableConfig, AceButton *button, EventTracker *eventTracker)
 
void init (uint8_t pin, uint8_t defaultReleasedState, uint8_t id)
 Reinitilize to its pristine state. More...
 
void pressButton (unsigned long time)
 Simulate a press of the button and run the button.check() processing. More...
 
void releaseButton (unsigned long time)
 Simulate a release of the button and run the button.check() processing.
 
void checkTime (unsigned long time)
 Simply move the time forward and check the button. More...
 

Detailed Description

A wrapper class that sends emulated button presses and released to the the underlying AceButton class, and captures the resulting events in the provided EventTracker.

Member Function Documentation

◆ checkTime()

void ace_button::testing::TestHelper::checkTime ( unsigned long  time)
inline

Simply move the time forward and check the button.

No changes to button.

◆ init()

void ace_button::testing::TestHelper::init ( uint8_t  pin,
uint8_t  defaultReleasedState,
uint8_t  id 
)
inline

Reinitilize to its pristine state.

◆ pressButton()

void ace_button::testing::TestHelper::pressButton ( unsigned long  time)
inline

Simulate a press of the button and run the button.check() processing.

The defaultReleasedState is determined by whether the button has a pullup (HIGH) or pulldown (LOW) resister.


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