Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

NeoPixel turns orange when I want it to turn off
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NeoPixel turns orange when I want it to turn off

by keithsoares on Sat Jun 27, 2020 4:18 pm

I'm a complete rookie, so this is probably a complete rookie mistake, but here goes...

I have a single NeoPixel (not a strip of multiple lights, just one light) wired like this to a Flora:

Flora VBATT => NeoPixel +
Flora GND => NeoPixel -
Flora #6 => NeoPixel DIn

I then have a simple sketch that sets a random number between 2000 and 8000 to represent between 2 seconds and 8 seconds of time. I use this for my delay(). Initially, I set the NeoPixel to a bright green:
strip1.setPixelColor(0, strip1.Color(0, 254, 0));

then, after the delay, I am trying to turn the NeoPixel off with this command:
strip1.clear();
(I have also tried this command: strip1.setPixelColor(0, strip1.Color(0, 0, 0)); )

The problem is that the NeoPixel never turns off. It successfully changes but does not go dark. Instead, it turns a sort of orange color, slightly dimmer than the bright green.

So, my code successfully sets a random delay and successfully changes the NeoPixel, but instead of turning off, it turns orange. Any help on this would be appreciated.

For the record, I am trying to do this with two NeoPixels and turn a servo at the same time, but I have eliminated all of that and reduced the code and wired connections to ONLY the single NeoPixel, and I still get orange instead of off.

Thanks
K.

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Re: NeoPixel turns orange when I want it to turn off

by dastels on Sat Jun 27, 2020 5:07 pm

Can you post the entire sketch, please. And also a clear photo of your wiring.

Dave

dastels
 
Posts: 3534
Joined: Tue Oct 20, 2015 3:22 pm

Re: NeoPixel turns orange when I want it to turn off

by keithsoares on Mon Jun 29, 2020 12:25 pm

Here's the sketch and three photos. The photos show a single NeoPixel and a small servo attached to a Flora. The code works to turn the servo, and the NeoPixel changes at the same time, but it turns orange instead of turning off.

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#include <known_16bit_timers.h>
#include <Adafruit_TiCoServo.h>

#define SERVO_PIN 10
Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(1,6,NEO_GRB+NEO_KHZ800);
long randNumber;
Adafruit_TiCoServo servo;
int pos = 0;

void setup() {
  // put your setup code here, to run once:
  servo.attach(SERVO_PIN);
  strip1.begin();
  strip1.show();
}

void loop() {
  // put your main code here, to run repeatedly:
  strip1.setPixelColor(0, strip1.Color(0, 254, 0));
  strip1.show();
  randNumber = random(2000, 8000);
  delay(randNumber);
  for (pos = 0; pos <= 180; pos += 1) {
    servo.write(pos);
  }
  strip1.clear();
  strip1.show();
  delay(2000);
  for (pos = 180; pos >= 0; pos -= 1) {
    servo.write(pos);
  }
}


Image with NeoPixel on: https://www.dropbox.com/s/kcgu3f7bhib4v ... 0.jpg?dl=0
Image with NeoPixel "off" but turns orange instead: https://www.dropbox.com/s/xlvb8ueochb0t ... 2.jpg?dl=0
Closeup image of Flora wiring: https://www.dropbox.com/s/crth8qw0nf2tb ... 0.jpg?dl=0

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Re: NeoPixel turns orange when I want it to turn off

by dastels on Mon Jun 29, 2020 1:51 pm

I'm always skeptical of alligator clips, especially on something so sensitive to data corruption as NeoPixels. But you say it always goes to that orange color when it's turned "off"?

Dave

dastels
 
Posts: 3534
Joined: Tue Oct 20, 2015 3:22 pm

Re: NeoPixel turns orange when I want it to turn off

by adafruit_support_bill on Mon Jun 29, 2020 2:00 pm

Another possible variable: Is it an RGB or an RGBW pixel?

adafruit_support_bill
 
Posts: 78759
Joined: Sat Feb 07, 2009 10:11 am

Re: NeoPixel turns orange when I want it to turn off

by dastels on Mon Jun 29, 2020 2:05 pm

I was wondering about that, Bill, but the green seems fine... and clearing it should write all 0s which shouldn't be impacted. Though I'm not sure how the pixel's shifter works. Hmm.. does the Flora Pixel even come in an RGBW version?

Dave

dastels
 
Posts: 3534
Joined: Tue Oct 20, 2015 3:22 pm

Re: NeoPixel turns orange when I want it to turn off

by keithsoares on Mon Jun 29, 2020 2:35 pm

This is the NeoPixel. I believe it is just RGB and not RGBW.
https://www.adafruit.com/product/1260

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Re: NeoPixel turns orange when I want it to turn off

by keithsoares on Mon Jun 29, 2020 2:38 pm

My end goal is to use conductive thread to sew this whole thing into a mask for cosplay for my daughter, but I am using the alligator clips now to try to get everything correct before I commit to sewing. The idea is that the two NeoPixels are light-up eyes, and the servo will control blinking eyelids. When the servo fires the blink movement, the lights go off in the eyes.

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Re: NeoPixel turns orange when I want it to turn off

by adafruit_support_bill on Mon Jun 29, 2020 2:47 pm

Not sure what happens if you send only 3 bytes to an RGBW. But it looks like the Flora's only come in RGB.

What happens if you send it a different color instead of turning it off?

adafruit_support_bill
 
Posts: 78759
Joined: Sat Feb 07, 2009 10:11 am

Re: NeoPixel turns orange when I want it to turn off

by keithsoares on Mon Jun 29, 2020 3:42 pm

I just ran a few tests.

If I do strip1.setPixelColor(0, strip1.Color(254, 0, 0)); the light turns red.
If I do strip1.setPixelColor(0, strip1.Color(0, 0, 254)); the light turns blue.
But if I try something like strip1.setPixelColor(0, strip1.Color(1, 1, 1)); the just turns orange and does not dim very much. (It looks identical to the photo I posted previously.)

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Re: NeoPixel turns orange when I want it to turn off

by adafruit_support_bill on Mon Jun 29, 2020 4:18 pm

That's pretty weird. Unless Dave has any other ideas I'd say a replacement is in order.

adafruit_support_bill
 
Posts: 78759
Joined: Sat Feb 07, 2009 10:11 am

Re: NeoPixel turns orange when I want it to turn off

by dastels on Mon Jun 29, 2020 5:18 pm

Nothing here. That's bizarre.

What product did you buy? The Flora Neopixels come is sets of 4 or 20. Or was it just a single in a project kit of some sort?

Dave

dastels
 
Posts: 3534
Joined: Tue Oct 20, 2015 3:22 pm

Re: NeoPixel turns orange when I want it to turn off

by keithsoares on Mon Jun 29, 2020 5:20 pm

It was exactly this. Four pack. https://www.adafruit.com/product/1260

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Re: NeoPixel turns orange when I want it to turn off

by dastels on Mon Jun 29, 2020 5:23 pm

Do all 4 behave this way?

Dave

dastels
 
Posts: 3534
Joined: Tue Oct 20, 2015 3:22 pm

Re: NeoPixel turns orange when I want it to turn off

by keithsoares on Mon Jun 29, 2020 5:31 pm

Wow. SOLVED.

It is a faulty NeoPixel.

I swapped it to another NeoPixel and it works perfectly. Sorry to bother everyone...

K.

keithsoares
 
Posts: 7
Joined: Sat Jun 27, 2020 3:57 pm

Please be positive and constructive with your questions and comments.