Go Down

Topic: Drive ws2812b with Arduino Mega 2560 using FastLED library. (Read 4245 times) previous topic - next topic

jgetrost

I just got some ws2812. I have one wired up according to the spec sheet I found that was published by world semico. I have just one hooked up to a Mega 2560 and am using the following code:

Code: [Select]
#include "FastLED.h"

#define NUM_LEDS 1
#define DATA_PIN 6

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}

void loop() {
  // Turn the first led red for 1 second
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(1000);

  // Set the first led back to black for 1 second
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(1000);
}


Here is an image of my setup. It's pretty basic.




I've been mostly just following a few blogs and youtube videos. I have spent a few hours looking up information and cannot seem to get even one LED to light. Any glaring issues or suggestions?">

Grumpy_Mike

It would help if your photograph of the LED was in focus so we could see the wiring. We all know what a fake Mega looks like.

jgetrost

It would help if your photograph of the LED was in focus so we could see the wiring. We all know what a fake Mega looks like.
My phone won't focus on it too well. I used a pen to try and trick it.

Grumpy_Mike

What I am trying to see is if the LED is wired correctly. In order to do this I need to see the orientating mark on your LED. This is not viable in the added photograph.
Also I can't see any 0.1uF ceramic capacitor across the power lines of the LED.

You changed your first post making my comment look silly. We don't like that round here. Please read this:-
How to use this forum it will tell you how we like to play things here.

This is how to wire up these LEDs

jgetrost

What I am trying to see is if the LED is wired correctly. In order to do this I need to see the orientating mark on your LED. This is not viable in the added photograph.
Also I can't see any 0.1uF ceramic capacitor across the power lines of the LED.

You changed your first post making my comment look silly. We don't like that round here. Please read this:-
How to use this forum it will tell you how we like to play things here.
My bad about editing the post.

The orientation mark is on the corner with the black wire going to ground. Red is 5v. Yellow is Data on Pin 6.

Is the capacitor necessary to drive a single LED? I was reading that this was to prevent flickering when using several of these in a chain.

INTP

Code looks ok, wiring looks correct, if the soldering is proper then I'd start seeing if the sketch is actually uploading. Are you clicking Upload and not just clicking Verify?
Sounds stupid but it has taken pages to reach that conclusion before.

Grumpy_Mike

Quote
Is the capacitor necessary to drive a single LED?
It is in the data sheet that each LED requires a decoupling capacitor, I have never used one without.

Quote
The orientation mark is on the corner with the black wire going to ground.
That sounds right.

The first photograph looks like the data is connected to pin 7 not 6 like the software says.

INTP

Also try using a different 5v pin, like the one actually under the "Power" label next to the gnd you're using

jgetrost

It is in the data sheet that each LED requires a decoupling capacitor, I have never used one without.
That sounds right.

The first photograph looks like the data is connected to pin 7 not 6 like the software says.
OK, I'm not sure. I don't have any capacitors so I can't test that. If I can't get anything else to work I'll look into getting some. The picture may look off, but I have double checked the wiring and used a multimeter to check the voltages.

Grumpy_Mike

Quote
I have double checked the wiring and used a multimeter to check the voltages.
Where did you probe?
You need to probe on the metal of the LED connector not on the soldered joint to make sure the joint is correctly made.

jgetrost

Where did you probe?
You need to probe on the metal of the LED connector not on the soldered joint to make sure the joint is correctly made.
I tried as well as I could to contact only the pads, but there isn't much room to work with, even with fine pointed probes.

Edit: Wired another up just the same in-case of a bad chip. Still nothing. I'm going to assume its a capacitor issue then.

Grumpy_Mike

It is possible that soldering the LED damaged it. I would try another one with thinner wires.

jgetrost

It is possible that soldering the LED damaged it. I would try another one with thinner wires.
Maybe, I just carefully wired a new one. Still nothing. I'll add a picture in one second.

INTP

So have you tried the other 5v pin or should I just let you go off worrying about capacitors?
Your clone board could simply be mislabeled as the pin could be aref with high resistance.
So the least you could do is try what I said.

jgetrost

So have you tried the other 5v pin or should I just let you go off worrying about capacitors?
Your clone board could simply be mislabeled as the pin could be aref with high resistance.
So the least you could do is try what I said.
I did. I didn't respond because I am rate limited on this new account, and figured that was a pretty obvious thing.

Go Up