ic Handbag Project

the annoying stuff you only need to do once ...

Prepare a Windows PC to work with Gemma

project guide showcase starter kit coding
   

A. Download Arduino software as ready for Gemma.

Adafruit have done the hard work of making the small changes needed to get a version of Arduino software that will run on your Windows PC/laptop so that it can communicate with Gemma.

NB As of 13 March 2014 the version on the Adafruit website has the fix to the chip_erase_delay that produces "expected 4 got 5" errors already done - so don't use older versions.

You can edit an existing Arduino installation, but that is a lot more work. If you are happy to do that consult the Adafruit website - the information is just under where you download the tailored version we recommend.

1. Get the software from Adafruit's website

So, create a folder on the PC you are going to download to and call it GemmifiedArduino. Next, go to the following web address and near the top is a blue button named "Windows Arduino IDE v1.05 with Trinket, Gemma, Flora". That will let you download a zip file to your folder (about 96MB for the March 2014 version).

learn.adafruit.com/introducing-gemma/setting-up-with-arduino-ide

2. Open the downloaded Zip.

Once you have the zip file unzip it to the same location (about 260MB). We keep a copy of this folder on memory stick ready for each new PC.

The contents of the folder you get should be something like the screenshot opposite.

You might want to setup a desktop shortcut to the Arduino.exe (rightclick, send to, desktop (create shortcut).

 

3. Open the Arduino application

Opposite is the initial empty Window you get when Arduino opens. That is where you will write your code (called a Sketch in Arduino). It uses a default filename from the date (in this example, "sketch_feb14").

It is too soon to do anything with Arduino yet, but there are a few useful settings we can make, as below.

arduino files in explorer

Above: the unzipped Arduino files
Below: a blank Arduino window.

blank Arduino window

The Gemma is based on the Atmel Attiny85 microcontroller, and that would not appear in the Arduino list as standard. This special version of Arduino has been Gemmified however - we just have to do the following:

4. Set Arduino to use Gemma board.

Go to the TOOLS dropdown in Arduino, then the Board menu option. You should have a listing for Adafruit Gemma 8MHz, though yours will probably be towards the bottom of the list.

Select that entry by going to it and releasing. When you show the listing again there should be a black dot next to Gemma.

Arduin Boards with Gemma
NB. On one of our netbooks the Board listing had Gemma so far down it was below the bottom of the page (3 below Arduino Robot Control) with no scroll option. We scrolled down 'blind' using the down arrow and then did a return. The selected item is listed in small print at the bottom right of the Arduino page so you can check it worked.

5. Set Arduino to look for USBtiny

Go to the TOOLS dropdown in Arduino again, but select the Programmer menu option. You should have a listing for USBtinyISP.

Select that entry by going to it and releasing. When you show the listing again there should be a black dot next to USBtinyISP.

 
You now have an installation of Arduino software that will let you write code, and that knows you plan to put it on an Adafruit Gemma board, and to do it using USBtinyISP, which is a standard protocol/method for communicating with boards.
 
The Neopixel library is the pre-written code that makes communicating with Adafruit's clever LEDs really easy.

6. About the NeoPixel library

You can take this step on trust if you are in a hurry.

The Neopixel library should already be installed for you. It is in the "libraries" folder of your Arduino software installation as opposite.

 

 

 

See NeoPixel
example code

The Neopixel library comes with two examples of the code. They are called Goggles and Strandtest.

You may find them useful later if you are looking for new coding ideas.

The screenshot opposite shows where the examples are located (File, Examples, Adafruit_NeoPixel.

Neopixel library files

Below: Examples in Arduino, showing a correctly installed NeoPixels option.

arduino NeoPixel examples

There are just a couple more useful changes to make at this stage, as we are working on the Arduino installation.

7. Set the Sketchbook location.

This is optional, but worth doing. the Sketchbook is where your code is kept. By default it will be somewhere like C:\Users\You\Documents\Arduino which is hidden away.

We normally create a higher level folder, maybe C:\GemmifiedArduino\Sketchbook but it is entirely up to you as to the name and location.

To make the change go to File, Preferences.

NB Show Verbose Output. While you are in the Preferences panel, tick "Show verbose output during upload". We find that very useful to see what is going on, particularly if you are having any trouble uploading (i.e. passing your code to Gemma - we will get to that later).

 
Summary: All of the above gets you a working Arduino installation pretty well setup to work with Gemma, thanks to Adafruit's hard work in preparing a version of Arduino specially for Gemma. If you already have the downloaded zip on a memory stick and have done it once or twice before it probably takes two minutes. We have a couple more steps to go though.

on to the Gemma driver page to see the next stage...