TheCodersCorner.com items tagged with digital-io.

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

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

Unit testing embedded and Arduino projects

By dave

When you've got more than the simplest embedded program for Arduino (or any other framework), it becomes much harder to test that it's working properly by purely running it. For something like Blink, testing is simple because all we need to do is upload it and see the LED turn on and off; there's little risk of missing anything significant. However,...

Simple Collection - btree list

By dave

IoAbstraction contains a very simple collection that is relatively lightweight and works on a wide range of boards. It is a btree list that provides ordering and list storage. It works on anything from Arduino Uno upwards! It's memory usage is very configurable, and the way it resizes arrays is also configurable too. You can set the initial size if you...

Simple Collection - Thread safe circular buffer

By dave

Circular buffer provides an easy way to interact with events that take place on another thread or in an interrupt, it is not very efficient when used on a single thread because it uses atomic operations to ensure consistency of the buffer. It is an advanced collection for use by users that understand threading and writing interrupt safe code. There are...

Task Manager Low Power example for SAMD boards

By dave

There are often cases when you'll need to run a micro controller from a battery power source. Unlike when running from mains power, every milli-amp matters. In these cases IoAbstraction's task manager is able to integrate easily with most low power libraries. Task manager works by repeatedly calling the function within or , during each loop task manager evaluates...

Stabilising an existing Arduino or embedded product

By dave

Sometimes the situation arises where a product is built (or gets close to being built), before any concerns about it's stability are discussed or proper planning arranged. Often this leads to code being written without any proper test plan in place. Combined with very tight deadlines there's often even no plan to go back and fix things up. Once this situation...

Getting started Unit testing with Arduino platform

By dave

This article discusses how to unit test a simple project with Arduino, if you're not used to writing unit tests, or need more background, then first read this guide on unit testing embedded projects . Presently, all our testing uses PlatformIO's inbuilt testing framework. It works pretty well overall, we wrote this because we needed the testing to work on...

Programming Arduino using tasks instead of loops - tutorial

By dave

In this tutorial for TaskManagerIO I explain the differences between traditional loop based programming; which is very common on the Arduino platform and event based programming based on taskManager. Although event based programming looks slightly more complicated at first, as the sketch and surrounding code gets more complex, eventing will scale to that much easier. Eventing task frameworks make ongoing maintenance...

Liquid Crystal fork example using IO Abstraction library - examples

By dave

Recently, I have made a fork of Arduino LiquidCrystal (HD44780 display driver library) that allows the library to work with the IO abstraction library, meaning you can configure a display to use Arduino pins, an i2c 8574 IO expander or shift registers by simply changing one line of code in your sketch. There are two additional examples provided with this version...

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.