This library provides abstractions that help you write event-driven Arduino and mbed applications. It has device abstractions that allow you to treat device pins, PCF8574, MCP23017, MPR121 and AW9523 almost the same in code. This includes higher level interrupt management, buttons with de-bouncing, matrix keyboards, rotary encoders and even LiquidCrystalIO. There are many examples packaged with the library that cover most use cases.

For development, you can use any Arduino or mbed IDE. However, our recommendation is platformIO with Clion or VS Code. We test the library with Arduino and PlatformIO.

Need help with a commercial design, or want a customised version for your hardware, see the consultancy link at the top of the page?

Reference guide and code repo

Digital IO for Arduino and mbed

Analog IO for Arduino and mbed

Switches, keyboards and rotary encoders

EEPROM abstractions

Logging, text utilities and unit testing helper classes

Working with Analog joysticks in IoAbstraction

By dave

IoAbstraction fully supports analog joysticks, and it does so in many modes, you can use them in three ways: You can get the values of the joystick using an directly. This is the simplest case and you would read the present floating point value as needed. You can treat an axis of the joystick as a rotary encoder, and either...

Touch screen support that works on all Arduino and mbed boards

By dave

IoAbstraction includes support for touch screens. The support is built in layers to allow for different drivers to be added over time. However, at the moment there is support for resistive touch screens on analog pins. This library can work with such touch screens regardless of analog input resolution, as long as the device is supported by IoAbstraction. As with switches...

Working with Analog input events in IoAbstraction

By dave

IoAbstraction has a class named to support event based programming for Analog Inputs, it is based on the class within the base library TaskManagerIO . The class itself is very flexible and can work with both polling and interrupt based approaches, or even a hybrid of the two. If you are not familiar with events, I recommend reading about...

IoAbstraction Analog Core documentation

By dave

IoAbstraction has a simple interface to the analog capabilities of all supported boards. It provides frequently used functionality around acquiring and setting analog values from ADC, PWM and DACs. Having the ability to read and write analog values as float, where the value is between 0 and 1; where 0 is off and 1 is fully on. this capability allows you...

IoAbstraction: Arduino Pins, IO Expanders, Shift Registers using same code

By dave

Using IoAbstraction you can write a sketch / program that uses Arduino pins, shift registers and IO expander devices at the same time, very much like you'd normally use Arduino pins. This library also provides simple interrupt handling that again is consistent across Arduino, mbed and IO expander ICs. What do we mean by consistent, we mean that configuring a pin,...

IoAbstraction: Switches and rotary encoder documentation

By dave

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...

Troubleshooting and mock objects for testing

By dave

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: Mock objects for use...

Timed blink - IO Abstraction library example

By dave

Timed blink is a version of well known Arduino blink example that is shipped with the standard IDE, but is redesigned to use the Abstraction and timer library. Example circuit for the code is exactly the same a blink, and if you use the inbuilt LED pin (which it does by default) then there's no need to build any circuit...

SPI and I2C/Wire abstraction that works on Arduino, mbed, PicoSDK

By dave

IoAbstraction has core I2C/Wire and SPI functionality provided by several functions, these abstract the use of I2C and SPI over Arduino, mbed, PicoSDK and other supported platforms. Over time the implementation of these will be improved, such that asynchronous behaviour will be possible on certain boards. Prior to 2.0, we had conditional I2C code scattered around the project, but now nearly...

Rotary encoder with non-polling (interrupt based) switches from PCF8574

By dave

IoAbstraction has full support for interrupts on most devices, meaning we can connect a Rotary Encoder to an Arduino using a standard PCF8574 IO expander chip. In order to do this we need the PCF8574 /INT line to be connected to an Arduino pin that supports interrupts (such as pins 2 or 3). Further, you can also have handle push...

These may be of interest

We use cookies to analyse traffic and to personalise content. We also embed Twitter and Youtube on some pages, these companies have their own privacy policies.

See the privacy policy and terms of use of this site should you need more information or wish to adjust your settings.