0

LEDs not working with M0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LEDs not working with M0

by batman189 on Sun Jun 02, 2019 9:40 pm

IMG_20190610_184031.jpg
IMG_20190610_184031.jpg (450.4 KiB) Viewed 226 times
IMG_20190610_184040.jpg
IMG_20190610_184040.jpg (178.65 KiB) Viewed 226 times
IMG_20190610_184051.jpg
Powered on
IMG_20190610_184051.jpg (273.81 KiB) Viewed 226 times
I am building the light up guardian sword and following the adafruit guide exactly. I ordered the same parts listed and have tripple checked my wiring. When I toggle the switch on, all the lights on the two boards come on, but the LED strip does not. I have checked with a meter and the LEDs are getting the 3.7 volts that the battery is putting out. Under the LEDs website description it says they need to be used with a 5v power supply, but the guide for this build lists and says the 3.75v battery will work.

Here is the adafruit guide I am following
https://learn.adafruit.com/breath-of-th ... d/overview
Last edited by batman189 on Mon Jun 10, 2019 8:12 pm, edited 1 time in total.

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by franklin97355 on Mon Jun 03, 2019 1:23 am

Can you post pictures of your connections to the strip? are you sure you are feeding the data line to the correct end of the strip?

franklin97355
 
Posts: 21087
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: LEDs not working with M0

by batman189 on Mon Jun 03, 2019 3:39 pm

https://photos.app.goo.gl/xr54oWPCL82NvHzy9

I snapped it really quick on the way out the door.

I did double check again the wiring. It does match the guide exactly

Lipo Backpack
5V on the Lipo Backpack to USB on the Trinket
GND on the Lipo Backpack to GND Trinket
BAT on the Lipo Backpack to BAT on the Trinket
The two through holes next to 5V on the Lipo Backpack to the two pins on the slide switch
NeoPixel Strip
+5V on the Strip is shared with BAT on the Trinket
GND on the Strip is shared with GND on the Trinket
D1 on the Strip to pin #4 on the Trinket

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by batman189 on Wed Jun 05, 2019 6:45 pm

anyone got any ideas???

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by adafruit_support_mike on Thu Jun 06, 2019 1:44 am

From the photo, it looks like the data signal is connected to the output end of the strip.

Check the markings on the strip: there should be an arrow indicating the direction the data signals travel between every other pair of pixels.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: LEDs not working with M0

by batman189 on Thu Jun 06, 2019 1:05 pm

Thanks for replying. On the LED strip the markings are Positive, Arrow, Negative. I have the Arrow, middle, connected to port 4 on the trinket.

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by franklin97355 on Thu Jun 06, 2019 1:14 pm

Is the arrow pointing away from your connection?

franklin97355
 
Posts: 21087
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: LEDs not working with M0

by batman189 on Thu Jun 06, 2019 1:28 pm

It is, yes. The arrow points down the strip, away from the wires.

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by XRAD on Mon Jun 10, 2019 10:16 am

can u post some better close up pics of all the components (both sides)? Very easy to load to this site.

edit images down to 800 pixels across using 'paint' or something similar.

Choose file, add file, and place in line...

There are some simple neopixel code samples we can test once the wiring is cleared..

XRAD
 
Posts: 507
Joined: Sat Nov 19, 2016 3:28 pm

Re: LEDs not working with M0

by batman189 on Mon Jun 10, 2019 8:11 pm

IMG_20190610_184018.jpg
IMG_20190610_184018.jpg (231.92 KiB) Viewed 226 times
IMG_20190610_184007.jpg
IMG_20190610_184007.jpg (413.62 KiB) Viewed 226 times
IMG_20190610_183900.jpg
IMG_20190610_183900.jpg (242.54 KiB) Viewed 226 times
3 is the limit so I will add the few others up top if I can

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by XRAD on Tue Jun 11, 2019 5:05 pm

With all white wires it is somewhat difficult to tell what goes where, but it is relatively simple wiring diagram for this build, so I assume you have it correct.

If you would like to test the trinket (break this down into major elements), you can unsolder the USB and the bat connections. Then connect the neopixels 5v to the trinket 5v (or USB 5v), and leave the neopixel ground to trinket ground connection, and data pin #4 out to data in on the neopixel strip. This way you isolate the charger unit.

Try to upload this easy test pattern to the trinket using correct programmer and port. I just happen to be using an 8mhz trinket, but this will work on all trinkets

Code: Select all | TOGGLE FULL SIZE

#include <Adafruit_NeoPixel.h>
#define PIN 4// data pin to neopixels
 

Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
 
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}


void loop() {
 
    colorWipe(strip.Color(255, 0, 0), 50); // Red
    colorWipe(strip.Color(0, 255, 0), 50); // Green
    colorWipe(strip.Color(0, 0, 255), 50); // Blue
    colorWipe(strip.Color(200, 200, 200), 50); // white
   
  }
 



you should see some neopixel action. If not, then there is another issue



IMG_3331.JPG
IMG_3331.JPG (182.98 KiB) Viewed 214 times

XRAD
 
Posts: 507
Joined: Sat Nov 19, 2016 3:28 pm

Re: LEDs not working with M0

by batman189 on Tue Jun 11, 2019 6:06 pm

Thanks for helping me so far.

I have not redone the connections again yet, just started with your code. It does not show any lights at all. I am still getting 3.78v with the mulitmeter on the LED strip

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by XRAD on Tue Jun 11, 2019 8:21 pm

OK so you are getting correct batt voltage.

I think that if the code uploaded OK, you need to start eliminating hardware by un-wiring( you don't have to necessarily un-solder at the board, you can cut the wires leaving some length to work with, as long as wire remnant conduction is good). I know it's a PITA, but bets way to test the Trinket before anything else.

just with the USB plugged into the Trinket( and no other wires connected), what voltage are you are getting out of the USB and 5v connection? If 5v, good. Let's move on to neopixels.

Closely check the neopixel solder connections for any stray grounds. Check that all the resistors are on the strip and the hardware looks good. Some neopixel strips don't work if a (first in line) neopixel burns out.

Now connect the neopixel strip data to #4, pixel Ground to trinket ground, and pixel power to the trinket 5V. If nothing happens, try changing PIN #4 in the code to PIN 0 in the code, and test pin 0 on the trinket. They are all digital and should work.

let's see where that gets you.......

XRAD
 
Posts: 507
Joined: Sat Nov 19, 2016 3:28 pm

Re: LEDs not working with M0

by batman189 on Thu Jun 13, 2019 12:49 am

Just the trinket into the USB gives 4.89 volts. I used new wire and connected:

Ground to negative on LEDs
USB to Positive on LEDs
Data to pin 0 on LEDs.
LEDs were getting 4.87 volts
LEDs did not turn on.

I changed pin 4 to pin 0 and updated the code. Nothing changed. LEDs are still getting 4.87 volts and not lighting.

batman189
 
Posts: 20
Joined: Sun Jun 02, 2019 9:37 pm

Re: LEDs not working with M0

by XRAD on Thu Jun 13, 2019 8:41 pm

Well, it may be the trinket. But before I give up on the hardware (because I have never had a bad one yet), would you mind trying one other very simple code?

This will only light the onboard dotstar three colors (R,G,B) for 1 sec each color. You will have to install the dotstar library (download the zip file and do not open it. save the whole zip file to your desktop and then add it to the arduino IDE using pic below as a guide) . In the code, the dotstar library link is provided:

Code: Select all | TOGGLE FULL SIZE
/*Original sketch here:
https://hackaday.io/project/9017-skywalker-lightsaber/log/72354-adafruit-trinket-m0-controlling-the-onboard-dotstar-led-via-arduino-ide

get the adafruit dotstar library zip file here:
https://github.com/adafruit/Adafruit_DotStar

tested and works fine on Adafruit Trinket M0

*/


#include <Adafruit_DotStar.h>

#define NUMPIXELS 1 // Number of LEDs in strip

// Here's how to control the LEDs from any two pins:
#define DATAPIN   7
#define CLOCKPIN   8

Adafruit_DotStar strip = Adafruit_DotStar(
  NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR);



void setup() {
  strip.begin(); // Initialize pins for output
  strip.show();  // Turn all LEDs off ASAP
}

void loop() {
  strip.setPixelColor(0, 0xFF0000); // red
  strip.show();
  delay(1000);

  strip.setPixelColor(0, 0x00FF00); // green
  strip.show();
  delay(1000);

  strip.setPixelColor(0, 0x0000FF); // blue
  strip.show();
  delay(1000);
}


you should see something like this (not just a cheese stick, but some real colors!):

IMG_3332.JPG
IMG_3332.JPG (188.99 KiB) Viewed 170 times



loading zip library to IDE:

dotstarpic.JPG
dotstarpic.JPG (89.87 KiB) Viewed 166 times

XRAD
 
Posts: 507
Joined: Sat Nov 19, 2016 3:28 pm

Please be positive and constructive with your questions and comments.