LeoStick Getting Started Guide
The Freetronics LeoStick is a handy break-out board for the ATmega32U4 microcontroller. The board has a convenient USB stick format, and is based on the pinout and connections of the Arduino Leonardo reference design for compatibility with the Arduino IDE. Before you plug in your LeoStick for the first time please read this section of the forum for any updates on installation and use.
The LeoStick uses the ATmega32u4 microcontroller and works with most Arduino software, and is even electrically (but not physically) compatible with typical expansion shields. It provides the same expansion headers as the Leonardo and other models such as the Arduino Uno, but in a different physical layout to match the super-small board.
The LeoStick is powered automatically by the USB connection from a host computer, or you can connect an external 5Vdc regulated power supply to run it independently.
- Keep it in your pocket! Plugs straight into any USB port.
- On-board RGB LEDs, one for full programmable RGB use and the other for Power, USB RX and TX status.
- On-board piezo sound generator.
- Supplied with low profile header socket strips to easily plug in any modules or extra hardware.
- ATmega32U4 microcontroller with 32K of Flash, 1K of EEPROM and 2.5K of RAM, running at 16MHz.
- Regular AVR 6 pin ISP connector for reflashing the bootloader or direct application programming.
- On-board reset button.
- 0.1″ pitch pin spacing, fits into solderless breadboard or veroboard pads.
Using the LeoStick with the Arduino IDE
The LeoStick can be programmed using the Arduino IDE, which is the software development environment designed to work with Arduino-compatible boards. Before you can load your programs onto the LeoStick you need to install the Arduino IDE (version 1.0.1 or newer, we recommend 1.0.4 or newer) and configure it to recognise your LeoStick board.
1. Download And Install Arduino IDE
If you don’t already have the Arduino IDE (v1.0.1 or newer) installed, please download the latest Arduino IDE for your operating system from www.arduino.cc/en/Main/Software and install it. You’ll also find more step-by-step guides for installation at www.arduino.cc/en/Guide/HomePage.
2. Download And Extract Board Profile
The “board profile” is what tells the Arduino IDE how to recognise a specific model of Arduino-compatible board. Download the latest board profile here. The current board profile version is 3.3.
The board profile is downloaded as a “.zip” archive. You should be able to double-click it to view and then extract the contents on your computer. Inside you’ll find a directory named “LeoStick” with the board profile.
Note: Previous versions of the board profile had separate v1 and v2 for different hardware revisions. Now all versions are bundled in a single board profile. If you have the old board profiles installed then you’ll need to delete them as you install the new bundled profile.
3. Install Board Profile
Check the location the Arduino IDE uses to store sketches, called the “Sketchbook” directory. On Windows this directory is called “Arduino” inside “My Documents”. On OS X it is also called “Arduino”, inside the “Documents” folder in your home folder. If you’re not sure where the Sketchbook directory is on your computer, you can find it by launching the Arduino IDE, choosing Preferences from the File menu, and looking at the “Sketchbook Location” field.
Inside the sketchbook directory, create a new directory called “hardware” if it doesn’t already exist.
Move or copy the board profile directory from Step 4 into the “hardware” directory. You should end up with a structure like “sketchbook/hardware/LeoStick”. There should be a file in that directory “sketchbook/hardware/LeoStick/boards.txt” (plus some other subdirectories.)
Restart the Arduino IDE so that it will recognise the new profile. Under the Tools -> Board menu you should see the additional options Freetronics LeoStick v1.0 and Freetronics LeoStick v2.0.
4. Install USB .inf File (Windows Only)
For Windows users only, the USB device file for the LeoStick must be downloaded and used for first-time installation of the LeoStick’s USB port. See http://www.freetronics.com/pages/installing-the-usb-driver-file-for-windows. Linux and MacOS do not require this step.
5. Check LeoStick Bootloader Type
You need to select the correct LeoStick Board (V1.0 or V2.0) in the Arduino IDE in order to upload sketches. If you choose the wrong version the upload process will not work correctly .
All recent LeoSticks are V2.0 and have the “Caterina” bootloader installed just like the final Arduino Leonardo. If your LeoStick is brand new, it will be V2.0 – you can skip to the next step.
Early LeoSticks are V1.0 and have the “Diskloader” bootloader installed (based on the Arduino Leonardo beta.)
The easiest way to identify your bootloader is to press the “Reset” button on your LeoStick (which starts the bootloader.) The LED will pulse on and off as if it is “breathing” for several seconds, and the two bootloaders breathe at different rates.
The V2.0 “Caterina” bootloader breathes fast (more than once a second):
The V1.0 “Diskloader” bootloader breathes much slower (about once a second):
It is possible to upgrade a LeoStick V1.0 to the V2.0 bootloader.
6. Initial Port Setup
Now we’re ready to do the initial board and port setup. You won’t need to do this again unless the serial port identifier changes such as when using a different USB port on your computer.
Launch the Arduino IDE, and select Tools > Board > Freetronics LeoStick v2.0 (or v1.0)
Before connecting your LeoStick to the USB port, have a look at the list of ports in Tools > Serial Port. That’s where your LeoStick is going to appear when you plug it in. Note: this menu option may be disabled until a new serial port appears, so if that’s the case simply proceed to the next step.
Connect your LeoStick to the computer USB port. After a short while if you look at Tools > Serial Port again you’ll see a new port appear: that’s the LeoStick ready to be used. Select that port now with Tools > Serial Port so there is a tick mark next to it.
Compiling and Uploading Your First Sketch
“Sketch” is the Arduino term for a program. To test uploading a simple sketch to your LeoStick, follow these steps.
Choose File > Examples > Digital > Blink. You’ll see the code for Blink open in the IDE.
Select Sketch > Verify/Compile, you’ve now built (compiled) the program ready to be loaded.
For more detail: LeoStick Getting Started Guide
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw