Introduction to the Coding Series
Simple I/O that is usually taken for granted on PCs, like reading key presses, outputting to a display, and sounding an alarm, often get in the way of the focus of the main task when developing for microcontrollers. It is for this reason we have developed a library for the multi-function shield we have chosen, and that which simplifies basic I/O operations. We also provide a set of real world applications that make use of this library, so those new to coding on the Arduino can experiment with and enhance them.
Some familiarity with the Arduino platform is assumed, as is the installation of the Arduino development environment. We got our shield from Hobby Components, but there are a number of other suppliers too. NOTE there are numerous versions of this shield, with some using a different LED display that requires some minor modifications in the library code. The simplest of the changes is to modify all implementations of WriteValueToSegment() in file MultiFuncShield.cpp. Please see the comments section.
Some shields have a passive beeper, and others have an active beeper. Presently, our library only supports the active beeper, although you should still be able to use the passive beeper with your own code.
Installing the Arduino multi-function shield library
For earlier versions of the shield library, you will need to first install the TimerOne and Software I2C libraries using instructions for installing Arduino libraries. The most recent library no longer needs TimerOne or Software I2C. You can download the multi-function shield library from the link below and install using the instructions from the link above:
- Multi-function shield library (download older version 1.2, version 1.1 or version 1.0 if necessary)
- All source code used in series
Although we do everything to ensure our downloads are free from viruses and malware, please check that your virus and malware scanning software is up to date before hand.
We must point out that by following the Hackatronics series, you agree to do so at your own risk, and agree to take full responsibility for any loss or damages you may incur upon yourself or others. If you’re a youngster starting out, be sure to have supervision of a responsible adult.
More about this series
This series is divided in to three main parts (and is also available as an eBook – please only download from this web site):
Part 1 demonstrates the ease with which the Arduino multi-function shield buttons, beeper and display can utilised by using the shield library, thereby making it easier to concentrate on the logic of the application. Part 2 demonstrates how the shield library can be used to read values from external sensors, such as temperature, sonar and motion sensors, and how to process electronic pulses from an external source. Part 3 explores working applications using the library and the Arduino multi-function shield:
- 24 hour alarm clock
- Heart monitor – (requires heart pulse sensor)
- Count down timer
- Surface incline level indicator– (requires MPU6050 motion sensor)
- Sonar ranger – (requires HC SR04 sonar module)
- Speedometer – (requires magnet and reed switch)
Each of these has scope to be built upon and expanded, but we leave that to you. Get coding and have fun!
New! Want to control your Arduino with an internet browser? Check out our new Arduino Web Server