I have had several stumbles during the path to getting my new Gemma 2 (from Adafruit) to work, though I have managed to work out most of the wrinkles and have been able to download and run successfully a version of the ubiquitous "Blink":
/*
Gemma_Blink
Turns on an LED on for one second, then off for one second, repeatedly. Note
that since the user-accessible LED is connected to I/O pin 1 (instead of pin 13
on the Arduino Uno), this sketch toggles pin 1.
Modified May 27 2015
*/
#define LED 1 //user-accessible LED is on I/O pin 1
void setup() {
pinMode(LED, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second (1000 milliseconds)
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second (1000 milliseconds)
}
What worked for me was to follow Adafruit's instructions for adding boards to the Arduino v1.6.4+ IDE:
Then by trial and error (after reading other user's results), I selected "USBtinyISP" in Tools>Programmer. I can select either "Arduino Gemma" or "Adafruit Gemma 8MHz" in Tools>Board and am able to download code.
The only problem I'm having - and am treating as merely a nuisance at the moment - is that after programming, the IDE gives this error message:
avrdude: error: usbtiny_receive: (expected 4, got -5)
Since my very simple code is up and running, I'm not bothered too much (at this time) - but I would like to understand what is going on. Any clues? I'll be looking into this a bit more, but am interested to hear what others have experienced with the Gemma. For what it's worth, my computer is running Windows 7 Home Premium; I have not tried other computers.