Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Homepage
This program aims at implementing a simple current reader which, sensing from an ACS712, prints on the USB port the average of n samples.
The program can be configured at compile-time by setting few defines:
- the number of channels: either only p20 or the sum of p19 and p20;
- the number of samples to read before printing their average
- the operating mode:
- PIN_TRIGGERED: read a handful of samples when the pin p9 rises
- USER_TRIGGERED: start reading when the user presses the character 's'
- ENDLESS_READ: read continuosly
First of all, when the program starts, it read a bunch of samples and then sets their mean value as reference. This means that the software assumes that when such a reference value is read, there is no current absorption.