Quick Review: Freetronics LeoStick (XC4266) Arduino Compatible Board

Just this week, I was gifted a Freetronics LeoStick from a colleague at the university, so I decided to take a look at it over the weekend. This particular unit seems to be distributed by Jaycar under catalogue number XC4266 for AU$29.95, or direct from their website on special for AU$26.00.

The Package

DSC_4439 DSC_4440

The product comes packaged in a static-shielding bag, with a stapled colour cardboard hanger top and a colour label on the front. It’s very compact, and good for static protection, but not very good against physical impact. It’s reminiscent of older “kit” packages.

DSC_4441

In the package, you get a colour double-sided page with instructions for getting started, downloading drivers and IDE software and specifications of the board. You also get the board, as well as another anti-static shielding bag with two compact 2.54mm headers, and six pin header for the ICSP header.

DSC_4442

The board itself uses the substrate and printed pads as a USB “compatible” connector for power and programming data. Power can also be fed through the pins directly if necessary. The board uses an ATMega32U4, as the Arduino Leonardo does, and features a 16Mhz clock crystal. Polyfuse protection and diode protection is available. To save space, one RGB LED is used for power, RXD and TXD indications, with another RGB LED available for program feedback. A reset button is provided as well.

DSC_4443

An enclosed surface mount piezo speaker is provided on the back, with its enclosed nature being sensible as it can generate spike voltages on physical stress. The silkscreen is very informative, labelling all the pins and peripheral connections. Power source and piezo disable can be enacted by cutting traces. This PCB is v1.1 by Jon Oxer.

Preparation – Soldering the Headers

If you wish to use this for re-usable prototyping, you will probably be interested in soldering the provided headers to the board. One word of advice – start with the shorter sockets on both sides, as the ICSP pins are taller and will make your life difficult if you don’t.

I found the soldering fairly nice, due to the use of gold-plated finish and solder-resist, however, if you don’t have a fine tipped iron or steady hands, you will find soldering around the piezo base rather tricky. Going slow and steady is the way to go.

DSC_4445

I’m not the best solderer around, but I’ve got to say that I’m not too bad at it and I managed to get it done fairly nicely.

DSC_4444

Experiences and Opinions

The Freetronics LeoStick is an Arduino Leonardo-compatible development board which comes in a stick form factor similar in size to the older Arduino Pro Mini. Because of the Arduino Leonardo basis, the board has USB connectivity for programming and for peripheral emulation (keyboard, mouse, etc) integrated using the same ATMega32U4 rather than relying on an off-board USB to Serial programmer. This makes for better convenience, although you should be aware of some Leonardo-specific quirks, such as SPI connections being only available via the ICSP header, faster USB serial connection data throughput but slightly different initialization requirements, and programmer reset problems under heavy USB serial traffic. As a bonus, the board retains the polyfuse and diode protection for the input power, which the Arduino Pro Mini forgoes.

However, for beginners, this board is slightly less friendly to work with as there is no direct plug-in compatibility with shields and the soldering of the pins can be slightly challenging especially to those without fine-tipped irons and a steady hand. Also of note is that no solder is included, but the versatility to only use the headers where you need them is appreciated. The integrated piezo can be disabled by cutting a trace, but the tri-colour LED needs to be desoldered, or the resistor pack desoldered to disable it. There is no on-board voltage regulators, as is the case for miniaturized versions of the Arduino, so you must supply only 5v to this board.

custom loader

Because of the issue of USB Vendor and Product IDs, the Arduino Leonardo IDs should not be used by clones. To be fair, Freetronics have used their own VID and PID combination, hence they require a separate driver package to be installed under Windows to make it work. However, if you are naughty like I am, you can go to Device Manager and force install the driver for the Arduino Leonardo from the IDE package (overriding the warning message) and use the Arduino Leonardo board selection in the IDE and it will work.

The best way to demonstrate the special feature of the piezo was to play some “music”. As I was part of the development of the ELEC2141 Digital Systems Design lab course at UNSW, we had developed a simplified square wave music lab exercise for students. As part of it, they were to develop the FPGA coding required to play music notated in a simple 4-bit tone and 4-bit duration packed into 1-byte format.

To make this lab work, we needed to get some music, and I spent some time transcribing some music from MIDI files using an editor into the byte-oriented binary format. Unfortunately, the songs I chose were never used in the lab partly because they weren’t considered “new” or cool enough to capture the students’ interest, but I still kept the binary data.

As a result, I decided to adapt a player using Arduino’s tone, and delay features to interpret the binary data, issue the tones, and play the music. Due to the size of the arrays, they needed to be stored with progmem into the flash, as there is not enough RAM for variables to hold it in RAM.

Musical_Leo-ArduinoIDECompiled

Therefore, it seems, my effort will finally see the light of day, playing on the LeoStick’s piezo speaker which is plenty loud to annoy the family from my room.

If you’d like to run it yourself, the music code can be downloaded as a text file here: musical-leo.txt, or you can copy and paste the source from the box below:

// A Musical Leostick Demo
// By Gough Lui (goughlui.com), transcribed from various MIDI files amassed over the years
// Based upon (a rather limited) music notation adapted for UNSW's ELEC2141/2 Course using FPGA's/ARM CPUs

#include <avr/pgmspace.h>

// Destiny's Child - Emotion
const char song1[] PROGMEM ={0x06, 0x51, 0x01, 0xA2, 0x08, 0xA9, 0x01, 0xB2, 0xA3, 0x04, 0x01, 0x51, 0x01, 0xA2, 0x08, 0xA9, 0x01, 0xB2, 0xA3, 0x04, 0xD2, 0x08, 0xDA, 0xC6, 0xC5, 0x07, 0x51, 0x01, 0xA1, 0x01, 0xA1, 0x08, 0xA9, 0x08, 0xAA, 0xB1, 0xC2, 0x81, 0xA1, 0x05, 0x01, 0x51, 0x01, 0xA2, 0xB2, 0xC2, 0x02, 0x81, 0x01, 0xA6, 0xA3, 0x01, 0x06, 0x04, 0xE1, 0x01, 0xE3, 0xF3, 0x02, 0xF1, 0xE1, 0xD3, 0x03, 0xD2, 0xC2, 0xA1, 0x01, 0xC4, 0xA5, 0xE2, 0xF2, 0x02, 0xF3, 0xE1, 0xD1, 0x03, 0xD1, 0x01, 0xD2, 0xC2, 0xA2, 0xC4, 0xA1, 0x91, 0xA4, 0xA1, 0xE2, 0xF2, 0x02, 0xF3, 0xE1, 0xD1, 0x03, 0xD1, 0x01, 0xD2, 0xC2, 0xA2, 0xC2, 0xA2, 0x92, 0x02, 0x81, 0x01, 0x81, 0x91, 0xA2, 0xB1, 0x01, 0xC2, 0xC4, 0x04, 0x91, 0xA1, 0xB2, 0xC1, 0x01, 0xB2, 0xC1, 0x01, 0xD2, 0xE1, 0x01, 0xD2, 0xE1, 0x01, 0xF3, 0x01, 0xD3, 0x01, 0xD2, 0xC2, 0xA2, 0xC4, 0xA3, 0x03, 0xF2, 0xD2, 0xC2, 0xD1, 0x01, 0xF3, 0x01, 0xD2, 0x02, 0xF3, 0x01, 0xD2, 0x02, 0xD4, 0xC3, 0x02, 0xC1, 0xD1, 0x01, 0xC1, 0x01, 0xD2, 0xF3, 0x01, 0xD2, 0x02, 0xF2, 0xD2, 0xC2, 0x02, 0xC4, 0xA3, 0x03, 0x82, 0x92, 0xA2, 0xB2, 0xC2, 0x08, 0xC9, 0x08, 0xC9, 0x08, 0xC9, 0x01, 0xD2, 0xC2, 0xB2, 0xA1, 0x01, 0xA2, 0xB2, 0x95, 0x82, 0x92, 0xA2, 0xC2, 0x08, 0xC9, 0x08, 0xC9, 0x08, 0xC9, 0x01, 0xD2, 0xC2, 0xB2, 0xA1, 0x01, 0xA2, 0xB2, 0x01, 0x96, 0x92, 0x06, 0x01, 0xA2, 0xC7, 0xC5, 0x05, 0xF3, 0x01, 0xD6, 0xD2, 0xC6, 0xA6, 0x00};
// Atomic Kitten - The Tide is High
const char song2[] PROGMEM ={0x06, 0x52, 0x83, 0x01, 0x82, 0x62, 0x83, 0x01, 0x81, 0x01, 0x82, 0x65, 0x82, 0x74, 0x04, 0x83, 0x01, 0x82, 0x61, 0x01, 0x83, 0x01, 0x82, 0x61, 0x01, 0x65, 0x82, 0x74, 0x04, 0xC4, 0xC1, 0xA1, 0x01, 0x91, 0x81, 0x92, 0xA2, 0x03, 0xB3, 0x93, 0x82, 0x73, 0x83, 0x91, 0x01, 0x94, 0xA4, 0x04, 0xC3, 0x01, 0xC3, 0xB3, 0xA1, 0xB1, 0xC3, 0x03, 0x51, 0x01, 0x51, 0x01, 0x51, 0x08, 0x5B, 0x82, 0xA2, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x42, 0x04, 0xA2, 0x93, 0x04, 0x01, 0x51, 0x08, 0x59, 0x01, 0x51, 0x08, 0x5A, 0x81, 0x01, 0xA2, 0x81, 0x01, 0x81, 0x01, 0x82, 0x43, 0x03, 0xA2, 0x93, 0x04, 0x01, 0xC4, 0xC1, 0xA1, 0x01, 0x91, 0x81, 0x92, 0xA2, 0x03, 0xB3, 0x93, 0x82, 0x73, 0x83, 0x91, 0x01, 0x94, 0xA4, 0x04, 0xC3, 0x01, 0xC3, 0xB3, 0xA1, 0xB1, 0xC3, 0x03, 0x52, 0x83, 0x01, 0x82, 0x62, 0x83, 0x01, 0x81, 0x01, 0x82, 0x65, 0x82, 0x74, 0x04, 0x83, 0x01, 0x82, 0x61, 0x01, 0x83, 0x01, 0x82, 0x61, 0x01, 0x65, 0x82, 0x74, 0x02, 0x52, 0x83, 0x01, 0x82, 0x62, 0x83, 0x01, 0x81, 0x01, 0x82, 0x65, 0x82, 0x74, 0x03, 0x83, 0x01, 0x82, 0x61, 0x01, 0x83, 0x01, 0x82, 0x61, 0x01, 0x65, 0x82, 0x74, 0x04, 0x66, 0x64, 0x53, 0x01, 0x54, 0x53, 0x03, 0x02, 0x66, 0x64, 0x53, 0x01, 0x54, 0x53, 0x00};
// Aerosmith - All Out of Love
const char song3[] PROGMEM ={0x06, 0x52, 0x62, 0x82, 0x08, 0x89, 0x01, 0x85, 0x92, 0x81, 0x01, 0xB2, 0xA2, 0x92, 0xA6, 0x52, 0x62, 0x82, 0x08, 0x89, 0x01, 0x94, 0xA4, 0x86, 0x84, 0x52, 0x62, 0x82, 0x08, 0x89, 0x01, 0x84, 0x81, 0x01, 0xB1, 0x01, 0xB1, 0x01, 0xB2, 0xA2, 0x08, 0xA9, 0x01, 0xA5, 0x08, 0xA9, 0x01, 0xC4, 0xB2, 0x08, 0xBA, 0xA5, 0x92, 0xA1, 0x91, 0x86, 0x82, 0x04, 0x52, 0x62, 0x82, 0x08, 0x89, 0x01, 0x83, 0x01, 0x92, 0x81, 0x01, 0xB2, 0xA2, 0x92, 0xA1, 0x91, 0x85, 0x52, 0x62, 0x81, 0x01, 0x81, 0x01, 0x83, 0x01, 0x93, 0x01, 0x91, 0xA2, 0x01, 0xA6, 0xA2, 0x02, 0x52, 0x62, 0x82, 0x08, 0x89, 0x01, 0x83, 0x03, 0xB2, 0x08, 0xBA, 0x01, 0xB2, 0xA1, 0x01, 0xA1, 0x01, 0xA5, 0x02, 0xC4, 0xB1, 0x01, 0xB2, 0xA3, 0x01, 0xB4, 0xA4, 0x95, 0x02, 0xA4, 0xB4, 0xA4, 0xB1, 0xA1, 0x95, 0xA1, 0x01, 0xA1, 0x01, 0xA1, 0x01, 0xA1, 0x01, 0xA1, 0x05, 0x01, 0x82, 0x91, 0x01, 0x91, 0x01, 0x92, 0xC3, 0x01, 0x94, 0x08, 0x9A, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x71, 0x64, 0x81, 0x01, 0x83, 0x01, 0x81, 0x01, 0x81, 0x01, 0xA3, 0x01, 0x92, 0x02, 0xA1, 0x01, 0xA1, 0x01, 0xA1, 0x01, 0xA1, 0x01, 0xA1, 0x05, 0x01, 0x82, 0x92, 0x08, 0x99, 0x01, 0x91, 0x01, 0xC3, 0x01, 0x94, 0x08, 0x9A, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x71, 0x64, 0x81, 0x01, 0x83, 0x01, 0x81, 0x01, 0x81, 0x01, 0xA3, 0x01, 0xA3, 0x01, 0xA4, 0x92, 0x86, 0x81, 0x00};
// Fleetwood Mac - Dreams
const char song4[] PROGMEM ={0x06, 0x64, 0x82, 0x94, 0xA5, 0x92, 0x84, 0x62, 0x86, 0x62, 0x84, 0x62, 0x95, 0x66, 0x63, 0x05, 0x01, 0x64, 0x82, 0x94, 0xA5, 0x92, 0x84, 0x92, 0x66, 0x63, 0x01, 0x07, 0x06, 0x04, 0xD1, 0x01, 0xD4, 0xC2, 0xF5, 0xE4, 0xC3, 0x01, 0xC5, 0xA3, 0x01, 0xA2, 0x08, 0xA9, 0x03, 0xA3, 0x01, 0xA5, 0x95, 0x91, 0x03, 0x62, 0xA2, 0x65, 0xA4, 0x62, 0xA4, 0x94, 0x84, 0x92, 0x66, 0x64, 0x02, 0x61, 0x01, 0x62, 0xA5, 0x92, 0x84, 0x02, 0x82, 0x62, 0x94, 0x83, 0x01, 0x84, 0x91, 0x01, 0x95, 0x91, 0x01, 0x61, 0x01, 0x62, 0xA5, 0x95, 0x82, 0x62, 0xA4, 0x94, 0x91, 0x01, 0x92, 0xA2, 0x92, 0x87, 0x81, 0x06, 0x04, 0x01, 0x91, 0x01, 0x92, 0xA2, 0x92, 0x87, 0x07, 0x02, 0xA3, 0x01, 0xA2, 0x02, 0xA2, 0x02, 0xA1, 0x01, 0xA3, 0x01, 0xA5, 0x94, 0x81, 0x01, 0x84, 0x95, 0x66, 0x63, 0x06, 0x05, 0x01, 0xA1, 0x01, 0xA1, 0x01, 0xA4, 0xA1, 0x01, 0xA1, 0x01, 0xA4, 0xD5, 0xC4, 0xA1, 0x01, 0xA4, 0x95, 0x84, 0x83, 0x01, 0x06, 0x04, 0xA3, 0x01, 0xA2, 0x08, 0xAD, 0x08, 0xA9, 0x03, 0x62, 0xA5, 0x94, 0x84, 0x54, 0x66, 0x65, 0x61, 0x01, 0x07, 0xA3, 0x01, 0xA1, 0x01, 0xA3, 0x01, 0xA4, 0xD5, 0xC4, 0xA3, 0x01, 0xA4, 0x92, 0x86, 0x83, 0x06, 0x03, 0xA3, 0x01, 0xA4, 0x92, 0x85, 0x81, 0x00};
// Shaggy - It Wasn't Me
const char song5[] PROGMEM ={0x06, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x08, 0x99, 0x08, 0x99, 0x08, 0x99, 0x08, 0x99, 0x01, 0xC1, 0x01, 0xA2, 0x91, 0x01, 0x91, 0x08, 0x99, 0x08, 0x99, 0x81, 0x91, 0x01, 0x81, 0x01, 0x53, 0x01, 0x05, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x01, 0x91, 0x08, 0x99, 0x08, 0x99, 0x01, 0xC1, 0x01, 0xA1, 0x01, 0x91, 0x01, 0x91, 0x08, 0x99, 0x08, 0x99, 0x81, 0x91, 0x01, 0x81, 0x52, 0x02, 0x32, 0x42, 0x54, 0x83, 0x01, 0x61, 0x01, 0x62, 0x52, 0x41, 0x01, 0x31, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x01, 0x32, 0x22, 0x02, 0x32, 0x42, 0x54, 0x83, 0x01, 0x61, 0x01, 0x62, 0x52, 0x41, 0x01, 0x31, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x01, 0x32, 0x22, 0x02, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x71, 0x61, 0x02, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x81, 0x01, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x71, 0x61, 0x02, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x71, 0x61, 0x02, 0x51, 0x08, 0x59, 0x08, 0x59, 0x08, 0x59, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x91, 0xA1, 0x02, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x81, 0x01, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x71, 0x61, 0x02, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x81, 0x01, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x71, 0x61, 0x02, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x81, 0x01, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x71, 0x61, 0x02, 0x51, 0x08, 0x59, 0x08, 0x59, 0x08, 0x59, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0xB2, 0xA1, 0x83, 0x05, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x91, 0x01, 0xA1, 0x03, 0x11, 0x08, 0x19, 0x08, 0x1A, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x08, 0x89, 0x91, 0x01, 0xA1, 0x03, 0x11, 0x08, 0x19, 0x08, 0x19, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x01, 0x83, 0x01, 0x11, 0x08, 0x19, 0x08, 0x19, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x01, 0xC1, 0x01, 0xC3, 0x01, 0x11, 0x08, 0x19, 0x08, 0x19, 0x81, 0x08, 0x89, 0x08, 0x89, 0x01, 0x08, 0x89, 0x08, 0x89, 0x91, 0x01, 0xA1, 0x03, 0x11, 0x08, 0x19, 0x08, 0x19, 0x01, 0x81, 0x08, 0x89, 0x08, 0x89, 0x01, 0x08, 0x89, 0x08, 0x89, 0x91, 0x01, 0xA1, 0x03, 0x11, 0x08, 0x19, 0x08, 0x19, 0x01, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x01, 0x83, 0x01, 0x11, 0x08, 0x19, 0x08, 0x19, 0x03, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x08, 0xA9, 0x01, 0xC1, 0x01, 0xC3, 0x01, 0x11, 0x08, 0x19, 0x08, 0x19, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x91, 0x08, 0x99, 0x08, 0x99, 0x08, 0x99, 0x08, 0x99, 0x01, 0xC1, 0x01, 0xA2, 0x91, 0x01, 0x91, 0x08, 0x99, 0x08, 0x99, 0x81, 0x91, 0x01, 0x81, 0x01, 0x53, 0x01, 0x05, 0xA1, 0x08, 0xA9, 0x08, 0xA9, 0x01, 0x91, 0x08, 0x99, 0x08, 0x99, 0x01, 0xC1, 0x01, 0xA1, 0x01, 0x91, 0x01, 0x91, 0x08, 0x99, 0x08, 0x99, 0x81, 0x91, 0x01, 0x81, 0x52, 0x02, 0x32, 0x42, 0x54, 0x83, 0x01, 0x61, 0x01, 0x62, 0x52, 0x41, 0x01, 0x31, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x01, 0x32, 0x22, 0x02, 0x32, 0x42, 0x54, 0x83, 0x01, 0x61, 0x01, 0x62, 0x52, 0x41, 0x01, 0x31, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x08, 0x39, 0x01, 0x32, 0x22, 0x02, 0x00};
// Tracy Chapman - Baby Can I Hold You
const char song6[] PROGMEM ={0x06, 0x82, 0x52, 0x06, 0x03, 0x81, 0x08, 0x8C, 0x94, 0x74, 0x83, 0x01, 0x83, 0x01, 0x06, 0x04, 0x84, 0x94, 0x74, 0x83, 0x01, 0x82, 0x06, 0x04, 0x02, 0x84, 0x94, 0x73, 0x01, 0x82, 0x92, 0x82, 0x06, 0x04, 0x81, 0x01, 0x82, 0x62, 0x04, 0x72, 0x52, 0x07, 0x06, 0x03, 0x81, 0x08, 0x8A, 0x52, 0x06, 0x03, 0x81, 0x08, 0x8C, 0x94, 0x74, 0x84, 0x08, 0x8A, 0x06, 0x05, 0x84, 0x94, 0x74, 0x83, 0x01, 0x82, 0x06, 0x05, 0x84, 0x94, 0x74, 0x82, 0x92, 0x82, 0x06, 0x04, 0x91, 0x08, 0x99, 0x08, 0x99, 0x61, 0x72, 0x04, 0x81, 0x51, 0x62, 0x06, 0x05, 0x01, 0xA1, 0x08, 0xA9, 0x91, 0x81, 0x01, 0x82, 0x52, 0x06, 0x04, 0xC2, 0xB2, 0xA1, 0x92, 0x84, 0x81, 0x63, 0x51, 0x08, 0x5A, 0x61, 0x01, 0x06, 0x04, 0xC2, 0xB2, 0xA1, 0x92, 0x84, 0x81, 0x62, 0x01, 0x51, 0x61, 0x51, 0x08, 0x5A, 0x05, 0x82, 0x01, 0x61, 0x51, 0x61, 0x51, 0x08, 0x59, 0x02, 0x06, 0x81, 0x08, 0x89, 0x08, 0x89, 0x08, 0x84, 0x81, 0x00};

int maptone[]={0,262,294,330,349,392,440,494,523,587,659,698,784,880,988,1047};
int mapdura[]={0,125,250,375,500,750,1000,2000,31,94,219,344,469,719,969,1969};

int temptone=0;
int tempdura=0;
int actone=0;
int acdura=0;

void setup () {
  playSong(song1);
  playSong(song2);
  playSong(song3);
  playSong(song4);
  playSong(song5);
  playSong(song6);
  pinMode(13,OUTPUT);
}

void loop() {
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
  delay(1000);
}

void playSong(const char *song) {
    char tempbyte;
    int bytecount=0;  
    while (tempbyte=pgm_read_byte_near(song+bytecount)) {
    actone=maptone[(tempbyte>>4)&0x0F];
    acdura=mapdura[tempbyte&0x0F];
    if(actone==0){
      noTone(11);
    } else {
      tone(11,actone,acdura);
    }
    delay(acdura);
    bytecount=bytecount+1;
  }
  noTone(11);
  delay(1000);
}

Conclusion

It seems Freetronics’ LeoStick is an Arduino Leonardo compatible with a form factor that mirrors the Arduino Pro Mini without any of the quirkiness of needing an off-board programmer. It also has more on-board peripherals and protection, but instead it trades in the Arduino Leonardo’s quirks. It’s got a likeable form factor that’s convenient, although not for direct use with shields, but will appeal for integrating into final projects or for breadboard prototyping. It’s priced around the same as a regular Arduino board, so you’ll have to decide whether this represents good value for your needs.

About lui_gough

I'm a bit of a nut for electronics, computing, photography, radio, satellite and other technical hobbies. Click for more about me!
This entry was posted in Electronics and tagged , , , , , . Bookmark the permalink.

2 Responses to Quick Review: Freetronics LeoStick (XC4266) Arduino Compatible Board

  1. ColinC says:

    Nice one! Found it really useful – especially the soldering advice. Thanks!

  2. Pingback: Reverse Eng Pt 2: Watts Clever Easy-Off w/SMART Box (ES-AUS1103) | Gough's Tech Zone

Error: Comment is Missing!