Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Adafruit Trinket (ATtiny85 @ 8MHz)"
Sketch uses 2300 bytes (43%) of program storage space. Maximum is 5310 bytes.
Global variables use 39 bytes of dynamic memory.
An error occurred while uploading the sketch
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 0
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800);
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.
void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
rainbow(20);
}
void rainbow(uint8_t wait) {
uint16_t i, j;
for (j = 0; j < 256; j++) {
for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i + j) & 255));
}
strip.show();
delay(wait);
}
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if (WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if (WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
Yeah each time I try to upload it I make sure I press the button on the trinket and the red light is flashing, I think I read somewhere that th flashing red light means it’s ready to be programmed?
Hello for some reason I could not make a new post in the forums but found this one and could only submit reply. So please forgive me for that.
First time user of Trinket 5V 8Mz.
I have set up Arduino IDE for the trinket and using Adafruit Trinket (ATtiny85 @ 8MHz) and USBtinyISP.
When I plug in the Trinket, Windows finds it and assigns a Port.
I get a Green LED and the other (middle?) LED is slowly changing color, the Red LED only flashes once upon reset. The color LED flashing bright pink once before it starts changing color. I have tried Upload and Upload Using Programmer.
What am I doing wrong?
Thanks
Hi, its a Trinket M0. I purchased it from Micro Center today. The LED below the flower logo is the one that is changing colors slowly, it did that out of the bag, it must be running something to do that, but everything I have seen say the red LED in the upper left is supposed to blink a few times, it only blinks once. I am new to this device so i am puzzled. Thanks fir the help.
Attachments
20190223_205458.jpg (766.05 KiB) Viewed 165 times
20190223_205458.jpg (766.05 KiB) Viewed 165 times
Last edited by romsk on Sat Feb 23, 2019 11:16 pm, edited 1 time in total.
Ok, the youtube video I saw online was wrong (that is why I had the wrong settings), but based on your advice I was able to get the Boards Manager to install Trinket M0 and I have selected that. So, I am further along now (thanks!) and it starts to do something - upload (program)? but its says "An error occurred while uploading the sketch", but nothing else. I found a 188+ page manual for the Trinket M0, but nothing jumped out at me to help with this.
After a closer look, I saw some messages about Java (see below after programming starts), but I thought the IDE takes care of all of that Java stuff.
Update: I decided to reboot my PC after updating the IDE to allow me to select the Trinket M0, which I have done. Now when I plug in the Trinket M0, I get a E: drive prop-up (like it is a thumb drive). Never got that before. Sometimes is looks like it is for the bootloader (see attached) and other times it looks like a python tool. Weird. Still cant program as per my last post. But the Java errors are gone. Thanks.
I have been reading up on trinket M0, when i get a e drive for curcuitpy, that means i am ready to program it with python. I was hoping to use Arduino IDE in C. But i guess python will work. What is says i dont even need any ide, just put s main.py script on the file browser window and the trinket m0 does, the rest. Is that correct? I read about double clicking the reset. I will try that tonight, i do not get curcuitpy to comr up all the time, i have to fiddle with it. why is the teally neat device so finicky?