IoAbstraction: Switches and rotary encoder documentation

By dave on November 15, 2018

Using SwitchInput for buttons and rotary encoders SwitchInput is a button and rotary encoder management library that treats button presses and encoder adjustments as events, similar to web and UI applications. Supporting as many switches and rotary encoders as you need, in an event driven way, working along with TaskManagerIO to keep your code clean. Key points: Buttons using either pull down or pull up logic connected directly or via any supported IO expander De-bouncing of events on all buttons and encoders to significantly reduce duplicate callbacks.

Troubleshooting and mock objects for testing

By dave on November 15, 2017

Troubleshooting IO issues using LoggingIoAbstraction Within the MockIoAbstraction.h header there is an implementation of BasicIoAbstraction that delegates through a logging layer. If you are having difficulty determining what your code is sending and receiving, this could be useful. You simply introduce the logging abstraction between your regular abstraction and the device you’re having trouble with. For example: LoggingIoAbstraction loggingAbstraction(internalDigitalIo()); ComponentThatNeedsDebugging debugging(internalDigitalIo()); ComponentThatNeedsDebugging debugging(asIoRef(loggingAbstraction)); Mock objects for use with Unit testing This library itself is quite well tested using our simple test facilities, and further it makes unit testing your code easier.

tcMenu for Arduino

This site uses cookies to analyse traffic, and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.

Send a message
X

Please use the forum for help with UI & libraries.

This message will be securely transmitted to our servers.