Trinket (and Pro Trinket) do not have a USB-serial converter chip on board, this is how we can make them so small! Instead of a serial console, the Trinket is programmed directly over USB. No COM/Serial port is used at all!
Sounds like the Trinket thinks its running at 8MHz but the Arduino software thinks it's running at 16MHz, this causes timing-specific stuff like Servos and NeoPixels to not work. Don't forget you must turn on 16MHz speedup if you are uploading to "Trinket 16MHz"
Do so by adding
At the very top of your sketch, and then
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
first thing in setup()
One fix that works for some people is to edit avrdude.conf and set the
chip_erase_delay = 900000;
under the ATtiny85 heading to
chip_erase_delay = 400000;
That is, a shorter delay.
You can use EITHER the 3V or 5V Trinket, at EITHER 8 or 16MHz!
To use with neopixels:
- Connect the + power line of the strip to VBUS (5V from USB), to VBAT if you are powering the Trinket with 4-7VDC, or to a separate 4-7VDC power source such as a 3 or 4 pack of AA batteries.
- Connect the - common ground to the battery pack (if being used) and also to the Trinket GND pin
- Connect the data in line to Trinket #1 - this will let you also see when data is being sent because the #1 red LED will flicker. You can use other pins but start with #1 since its easiest to debug and use
- Install the NeoPixel library as detailed in our Uber Guide, and change the PIN to 1 (its 6 by default)
- Upload and enjoy!
That tutorial also shows how to use the TinyM I2C driver, which works great on the ATtiny85, and adapt other existing libraries for the Trinket
On a new trinket, the main sketch will automatically jump back to the bootloader, which will then cause the 'connect' sound. This cycle will repeat until a user sketch is loaded.
This situation can also happen if you load a sketch with a bug in it that causes a CPU reset.
Technically yes - you can provide regulated 5V or 3.3V directly to the lower right hand power pin. However, the regulator dropout is quite low, its safer and better to power the VBAT pin since that way you wont be 'fighting' the USB port if you plug in USB