Chances are, you picked up a Trinket considering it is programmable with the Arduino IDE. Note that the Trinket is not a full Arduino-compatible, it uses a different (smaller) chip than the Uno, Mega, Leonardo or Due. However, there are many small sketches and libraries that will work just fine. Some may non even demand anything other than pin number changes.

Fifty-fifty though Trinket has a USB connector, it does not have a "Series Console" capability, so you cannot use Serial to send and receive data to/from a computer! It will non prove upward as a PORT in the setup menu

In that location is currently a bug in Arduino 1.8.7 which requires you lot to select a Port before upload merely we don't apply Ports for Pro Trinket uploads. If you don't take a Serial Port available to select, please use Arduino 1.eight.6

Arduino IDE Setup

Just follow the steps in the steps in the Adafruit Arduino IDE setup guide to hands add together support for Trinket, Gemma, Pro Trinket & more to the Arduino IDE.

You will need Arduino IDE i.6 or greater

When you're finished installing the IDE & board manager add on come back to this folio to continue the Trinket guide.

Glimmer!

After installing the Arduino IDE with back up for Adafruit's boards you can load a elementary blinking LED instance to examination uploading to Trinket works as expected.  Open the Arduino IDE and replace the sketch code with the following blink code:

If you are using Linux you lot may accept to be "root" running the Arduino plan to have access to the USB port (or add together udev exceptions)

                  /*   Blink   Turns on an LED on for one 2nd, then off for one second, repeatedly.     This example lawmaking is in the public domain.    To upload to your Gemma or Trinket:   ane) Select the proper board from the Tools->Board Bill of fare   two) Select USBtinyISP from the Tools->Programmer   3) Plug in the Gemma/Trinket, brand sure you see the green LED lit   4) For windows, install the USBtiny drivers   five) Press the button on the Gemma/Trinket - verify you see      the red LED pulse. This ways information technology is ready to receive data   vi) Click the upload push above inside x seconds */   int led = i; // blink 'digital' pin 1 - AKA the congenital in blood-red LED  // the setup routine runs once when you press reset: void setup() {   // initialize the digital pin as an output.   pinMode(led, OUTPUT);  }  // the loop routine runs over and over once again forever: void loop() {     digitalWrite(led, Loftier);      delay(thousand);     digitalWrite(led, LOW);     filibuster(1000); }                
                  /*   Blink   Turns on an LED on for one second, and so off for one second, repeatedly.     This example code is in the public domain.    To upload to your Gemma or Trinket:   1) Select the proper board from the Tools->Lath Menu   2) Select USBtinyISP from the Tools->Programmer   3) Plug in the Gemma/Trinket, make certain you see the green LED lit   4) For windows, install the USBtiny drivers   v) Press the button on the Gemma/Trinket - verify you see      the cherry-red LED pulse. This ways information technology is ready to receive information   6) Click the upload button above within x seconds */   int led = ane; // blink 'digital' pivot i - AKA the built in ruby LED  // the setup routine runs once when you press reset: void setup() {   // initialize the digital pin as an output.   pinMode(led, OUTPUT);  }  // the loop routine runs over and once again forever: void loop() {     digitalWrite(led, High);      delay(1000);     digitalWrite(led, Low);     delay(1000); }                

Select the Trinket 8MHz board from the Tools->Lath menu

adafruit_products_selecttrinket.gif

Then, select USBtinyISP from the Tools->Programmer sub-card

When y'all're set to upload, make certain the "Programmer" in the Tools menu is set to USBtinyISP!

trinket_adafruit_products_selectusbtiny.gif

The Serial Port carte du jour will not bear witness the Trinket, that'south normal!

Plug in the Trinket, make certain y'all see the greenish LED lit (ability good) and the red LED pulsing.

Printing the push button if the red LED is not pulsing, to get into bootloader style.

Click the Upload push button (or select File->Upload)

trinket_adafruit_products_upload.gif

If everything goes smoothly you should see the following (no crimson error letters) and of class, the red LED on the trinket will blink on/off in one case a second

trinket_adafruit_products_blinkOK.gif

Something Went Wrong!

If y'all become the fault bulletin avrdude: Error: Could not discover USBtiny device (0x1781/0xc9f)

That means the bootloader wasn't active. Make sure to press the push on the Trinket to actuate the bootloader earlier clicking the Upload push button.

trinket_adafruit_products_idecouldntfind.gif

If yous become a lot of red text, errors and as well a warning about Verification Failed


Try over again! Make sure you lot have a good USB cable, effort connecting through a hub if y'all have one.

trinket_adafruit_products_verifcationfail.gif

On Linux if you get the fault bulletin "usbtiny_receive: error sending control message: Protocol error (expected four, got -71)"

These can by and large exist ignored and should not interfere with the program upload.  Unfortunately Linux's USB core is a piddling flakey communicating with the ATtiny85 processor on the Trinket/Gemma and can cause these errors.  If an upload does fail, try information technology over again as it is likely an intermittent consequence.

This guide was get-go published on Sep 03, 2013. It was last updated on Sep 03, 2013.

This page (Setting upward with Arduino IDE) was concluding updated on Apr fifteen, 2022.

Text editor powered past tinymce.