Chances are, you lot picked up a Trinket because it is programmable with the Arduino IDE. Notation that the Trinket is non a total Arduino-compatible, it uses a unlike (smaller) chip than the Uno, Mega, Leonardo or Due. However, in that location are many small sketches and libraries that volition piece of work just fine. Some may non even need annihilation other than pivot number changes.

Even though Trinket has a USB connector, it does not have a "Series Console" capability, so you cannot employ Serial to transport and receive data to/from a reckoner! Information technology will not evidence upwardly as a PORT in the setup bill of fare

There is currently a problems in Arduino i.8.7 which requires you to select a Port before upload but we don't utilize Ports for Pro Trinket uploads. If y'all don't have a Series Port available to select, delight employ Arduino 1.8.6

Arduino IDE Setup

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

Yous will need Arduino IDE one.6 or greater

When you're finished installing the IDE & lath manager add on come dorsum to this page to proceed the Trinket guide.

Blink!

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

If yous are using Linux y'all may have to be "root" running the Arduino program to take access to the USB port (or add udev exceptions)

                  /*   Blink   Turns on an LED on for ane second, so off for 1 2nd, repeatedly.     This example lawmaking is in the public domain.    To upload to your Gemma or Trinket:   1) Select the proper lath from the Tools->Lath Menu   2) Select USBtinyISP from the Tools->Programmer   3) Plug in the Gemma/Trinket, brand sure you run into the green LED lit   iv) 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 prepare to receive information   6) Click the upload push button above inside 10 seconds */   int led = 1; // glimmer 'digital' pin one - AKA the built in 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 again forever: void loop() {     digitalWrite(led, HIGH);      delay(one thousand);     digitalWrite(led, Depression);     filibuster(1000); }                
                  /*   Blink   Turns on an LED on for one 2d, then off for one 2nd, repeatedly.     This example lawmaking 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   iii) Plug in the Gemma/Trinket, make sure you see the green LED lit   four) For windows, install the USBtiny drivers   5) Press the button on the Gemma/Trinket - verify you meet      the red LED pulse. This means it is set up to receive data   6) Click the upload button above within x seconds */   int led = ane; // blink 'digital' pivot 1 - AKA the congenital in red LED  // the setup routine runs once when yous printing reset: void setup() {   // initialize the digital pin every bit an output.   pinMode(led, OUTPUT);  }  // the loop routine runs over and again forever: void loop() {     digitalWrite(led, HIGH);      delay(1000);     digitalWrite(led, Depression);     delay(1000); }                

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

adafruit_products_selecttrinket.gif

Then, select USBtinyISP from the Tools->Programmer sub-bill of fare

When you're ready to upload, make sure the "Programmer" in the Tools bill of fare is prepare to USBtinyISP!

trinket_adafruit_products_selectusbtiny.gif

The Serial Port carte du jour will not show the Trinket, that'southward normal!

Plug in the Trinket, brand sure you meet the green LED lit (power good) and the red LED pulsing.

Press the button if the scarlet LED is not pulsing, to become into bootloader way.

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

trinket_adafruit_products_upload.gif

If everything goes smoothly you should come across the post-obit (no cherry-red error letters) and of course, the reddish LED on the trinket volition blink on/off once a second

trinket_adafruit_products_blinkOK.gif

Something Went Wrong!

If you get the error bulletin avrdude: Error: Could non find USBtiny device (0x1781/0xc9f)

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

trinket_adafruit_products_idecouldntfind.gif

If you get a lot of blood-red text, errors and besides a warning about Verification Failed


Effort once more! Brand certain y'all accept a good USB cable, effort connecting through a hub if y'all have one.

trinket_adafruit_products_verifcationfail.gif

On Linux if you lot get the error message "usbtiny_receive: error sending command message: Protocol mistake (expected 4, got -71)"

These can generally be ignored and should not interfere with the program upload.  Unfortunately Linux'southward USB cadre is a little flakey communicating with the ATtiny85 processor on the Trinket/Gemma and tin crusade these errors.  If an upload does fail, try information technology again equally it is likely an intermittent issue.

This guide was first published on Sep 03, 2013. It was terminal updated on Sep 03, 2013.

This folio (Setting upwardly with Arduino IDE) was last updated on Apr x, 2022.

Text editor powered by tinymce.