Home‎ > ‎DroidBuilders Blog‎ > ‎

AVC 2014 Announced, Adafruits' Trinket

posted Jan 8, 2014, 10:11 PM by Galen Raben   [ updated Jan 8, 2014, 11:37 PM ]
January 8, 2014:
Happy New Year! It has been several months since I last posted anything. Don't know how I missed seeing it before but just noticed this announcement that the date has been chosen for Sparkfuns' 2014 AVC (Autonomous Vehicle Competition) - June 21st, 2014! Looking forward to perhaps being there again this year - perhaps even with my own entry into the competition! Will post more as it gets closer to actually running...

Also I've been waiting to post their recap video which was also in their announcement. I've added it to my AVC 2013 blog post. Here it is again if you haven't seen it...

AVC 2013 recap video

The last few months I've been playing with a few new toys which I will blog about as I get time. The most significant of these is Adafruits' new Trinket - which is a tiny Arduino compatible board. Since DroidBuilder was started I've carried my own board designs (which have been based on the SpeakJet and RoboVoice speech synthesis chips) but have always wanted to carry other items which would be of use to the hobbyist robot builder. The Trinket appears to meet all of my requirements - low cost, small, easy to build, easy to program, and of course, useful to the robotics hobbyist.

Adafruit Trinket

I was excited to see my Trinkets when they arrived, they were even smaller than they looked in the Adafruit website. But quickly my enthusiasm waned when I plugged them in and was not able to program them. 

Trinket Arduino Fail screen

After double checking that I done everything mentioned in their Trinket Guided Tour, and finding I had done everything right, I stumbled across this article in the Adafruit Customer Support Forums... Voila!! The avrdudetrinket11513.zip file was the answer - got my Trinket uploading as I expected. My first project is in the following photo - a quick hack for testing my trinket.. a Trinket blinky!

I'll post video shortly..


This is running the following sketch. I adapted the code from the Arduino Blink sketch given in the Arduino example sketches.


Turns on an LED on for one half second, then turns on the next LED in chain.
When all four LEDs have been lit then it turns them off in the same fashion

This example code is in the public domain.

To upload to your Gemma or Trinket:
1) Select the proper board from the Tools->Board Menu
2) Select USBtinyISP from the Tools->Programmer
3) Plug in the Gemma/Trinket, make sure you see the green LED lit
4) For windows, install the USBtiny drivers
5) Press the button on the Gemma/Trinket - verify you see
the red LED pulse. This means it is ready to receive data
6) Click the upload button above within 10 seconds

int led0 = 0;
int led1 = 1; // blink 'digital' pin 1 - AKA the built in red LED
int led2 = 2;
int led3 = 3; 
int led4 = 4;

// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  pinMode(led0, OUTPUT);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
   pinMode(led4, OUTPUT);

// the loop routine runs over and over again forever:
void loop() {
  // turn 'em on
  digitalWrite(led0, HIGH);
  digitalWrite(led1, HIGH);
  digitalWrite(led2, HIGH);
  digitalWrite(led3, HIGH);
  digitalWrite(led4, HIGH);
  // turn 'em off
  digitalWrite(led0, LOW);
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  digitalWrite(led3, LOW);
  digitalWrite(led4, LOW);

As you can see it is a  very straightforward hack. No special tricks or shortcuts here!

Expect to see more projects here using the Trinket from time to time... :-)
Till next time...