trinket not working

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

trinket not working

Post by bcook65 »

Hello
recently purchased the trinket powered neopixel goggles. Came with the 5v trinket.
Got everything wired and soldered. had some initial issues with programming it.. originally used my arduino IDE to upload sketch (or tried) but got so many errors I didnt even want to count them..
Ended up installing the trinket IDE.
Seem to upload to the trinket okay and only had one error:

Binary sketch size: 3,438 bytes (of a 5,310 byte maximum)
avrdude: usbdev_open(): did not find any USB device "usb"

Followed the directions on the site.. pressed the button on the trinket, the red light flashes and hit the upload sketch button.
it compiles and uploads.. dont know if it is supposed to or not but the red light stops blinking maybe about halfway during the process..

When I disconnect from usb and connect the charged battery, nothing happens. Initially when I plug the battery into the board a couple of the (blue) leds on each ring flash very briefly and weakly.

Code: Select all

// Low power NeoPixel goggles example.  Makes a nice blinky display
// with just a few LEDs on at any time.
 
#include <Adafruit_NeoPixel.h>
#ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc.
 #include <avr/power.h>
#endif
 
#define PIN 0
 
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN);
 
uint8_t  mode   = 0, // Current animation effect
         offset = 0; // Position of spinny eyes
uint32_t color  = 0xFF0000; // Start red
uint32_t prevTime;
 
void setup() {
#ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc.
  if(F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
  pixels.begin();
  pixels.setBrightness(85); // 1/3 brightness
  prevTime = millis();
}
 
void loop() {
  uint8_t  i;
  uint32_t t;
 
  switch(mode) {
 
   case 0: // Random sparks - just one LED on at a time!
    i = random(32);
    pixels.setPixelColor(i, color);
    pixels.show();
    delay(10);
    pixels.setPixelColor(i, 0);
    break;
 
   case 1: // Spinny wheels (8 LEDs on at a time)
    for(i=0; i<16; i++) {
      uint32_t c = 0;
      if(((offset + i) & 7) < 2) c = color; // 4 pixels on...
      pixels.setPixelColor(   i, c); // First eye
      pixels.setPixelColor(31-i, c); // Second eye (flipped)
    }
    pixels.show();
    offset++;
    delay(50);
    break;
  }
 
  t = millis();
  if((t - prevTime) > 8000) {      // Every 8 seconds...
    mode++;                        // Next mode
    if(mode > 1) {                 // End of modes?
      mode = 0;                    // Start modes over
      color >>= 8;                 // Next color R->G->B
      if(!color) color = 0xFF0000; // Reset to red
    }
    for(i=0; i<32; i++) pixels.setPixelColor(i, 0);
    prevTime = t;
  }
}
Attached some photos of the rings and trinket (soldering).
most of the connections look okay.. although after seeing the pics I did notice a couple of pads that were not completely covered. But I have gone back and corrected those.. The insulation on those wires are so heat sensitive. tried to be as quick and thorough as I could be without melting back the insulation too far.
Left Eye back NPR.jpg
Left Eye back NPR.jpg (964.04 KiB) Viewed 957 times
Left Eye front NPR.jpg
Left Eye front NPR.jpg (955.04 KiB) Viewed 957 times
Right Eye back NPR.jpg
Right Eye back NPR.jpg (981.35 KiB) Viewed 957 times

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

Right Eye front NPR.jpg
Right Eye front NPR.jpg (136.1 KiB) Viewed 956 times
trinket back.jpg
trinket back.jpg (631.66 KiB) Viewed 956 times
trinket front.jpg
trinket front.jpg (777.66 KiB) Viewed 956 times

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

still no resolution.. not sure where or what the issue is with this thing..

User avatar
Funman1
 
Posts: 376
Joined: Fri Nov 28, 2014 2:13 am

Re: trinket not working

Post by Funman1 »

The error you are getting means it can't "see" the device.
It almost looks like you have a solder bridge on the #0 and the USB + on the top side of the board. This would keep the USB from working correctly.
Post a closer pic of that solder joint, does windows see the trinket in device manager?

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

Funman1 wrote:The error you are getting means it can't "see" the device.
It almost looks like you have a solder bridge on the #0 and the USB + on the top side of the board. This would keep the USB from working correctly.
Post a closer pic of that solder joint, does windows see the trinket in device manager?

will get a pic.. but turns out it is not a solder bridge.. some of the rosin pooled between the pads.. removed it.. turns out, it is not being recognized in device manager

User avatar
AnneBarela
Learn User Page
 
Posts: 757
Joined: Sat Mar 24, 2012 8:56 pm

Re: trinket not working

Post by AnneBarela »

Be sure you selected USBtinyISP for programmer. Such issues are covered in the book Getting Started with Adafruit Trinket and other forum posts.

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

thekitty wrote:Be sure you selected USBtinyISP for programmer. Such issues are covered in the book Getting Started with Adafruit Trinket and other forum posts.
Does it come in a bottle so I can just pour it in to my head?.. :)
Guess it is a good thing I recently purchased that.. lol.. will peruse it and see what I can see.

thanks

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

Okay, I seem to have resolved the trinket connection issues.. Dont know if I missed that step in the setup process or what but it didnt happen. So now the computer sees it and recognizes it. I have my programmer set to the usbtinyisp and the adafruit trinket 8mhz selected as my board..

now comes my next question.. on the programming, if I am copying code directly from the website into the ide, which should minimize or remove typos or syntax errors, why would the code generate errors when compiling, verifying or uploading (providing the computer is actually communicating with the trinket)??

I believe the code early in the post was from somewhere on the site, but now it gives me the following errors..

Code: Select all

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN);
(this was the highlighted line error, and below was the list of errors)

Code: Select all

sketch_jan21b:11: error: 'Adafruit_NeoPixel' does not name a type
sketch_jan21b.ino: In function 'void setup()':
sketch_jan21b:22: error: 'pixels' was not declared in this scope
sketch_jan21b.ino: In function 'void loop()':
sketch_jan21b:35: error: 'pixels' was not declared in this scope
sketch_jan21b:62: error: 'pixels' was not declared in this scope

User avatar
AnneBarela
Learn User Page
 
Posts: 757
Joined: Sat Mar 24, 2012 8:56 pm

Re: trinket not working

Post by AnneBarela »

You need to install the Neopixel library into the IDE. In the Adafruit Learning System, see the Uberguide to Neopixels.

User avatar
Funman1
 
Posts: 376
Joined: Fri Nov 28, 2014 2:13 am

Re: trinket not working

Post by Funman1 »

Yep that error is from not having the Neopixel library installed :)

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

thanks.. getting closer.. :) the ide made for the trinket seems to be having a lot of errors .. so I set up arduino 1.0.6 and moved the adafruit neopixel library over to that and pasted the sketch into that.. it is compiling fine with no errors.. I now get the following error messages.. hehehe and I almost understand them.. :) almost

Binary sketch size: 3,516 bytes (of a 5,310 byte maximum)

avrdude: error: usbtiny_transmit: usb_control_msg: sending control message failed, win error:
A device attached to the system is not functioning.

avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: error: usbtiny_transmit: usb_control_msg: sending control message failed, win error:
A device attached to the system is not functioning.


I have tried 3 different usb cables with the same result and 3 different usb ports

User avatar
Funman1
 
Posts: 376
Joined: Fri Nov 28, 2014 2:13 am

Re: trinket not working

Post by Funman1 »

Hmm I don't know that error, I would uninstall and remove ALL Arduino IDE.
Download the one from Adafruit and then install the neo drivers and start over from scratch

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

ugh.. Funman, your killin me.. lol.. guess aint nuttin to do but ta get to it.. *rolls up sleeves* oo.. Ice cream.. guess it can wait till tomorrow.. :)

User avatar
Funman1
 
Posts: 376
Joined: Fri Nov 28, 2014 2:13 am

Re: trinket not working

Post by Funman1 »

Haha yeah sorry not quite sure what to tell you, mine went REALLY smoothly a few months ago when I did it so... LOL
But it should not take more than 5 mins to uninstall / then unzip the Adafruit one
Then unzip and rename the neopixel folder and place it into the libraries folder...

It's pretty quick now that you know exactly what you need to do and the order to do it in.

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: trinket not working

Post by bcook65 »

Okay, Started totally from scratch. Uninstalled all my arduino ide's and installed only the trinket IDE one.. Arduino 1.0.5..

get same error message

avrdude: error: usbtiny_transmit: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning.

looks fine in device manager

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”