0

NeoPixel Library version 1.1.1 Quesion
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NeoPixel Library version 1.1.1 Quesion

by joshuakane on Tue Jun 13, 2017 9:35 am

Hello,

I picked up some Neopixel Jewels for a project. In trying to program them I found I needed to upgrade my NeoPixel Library from 1.0.0 to 1.1.1. That went without incident and the project was completed without issue.

I went back to work on another project where I have some of your 60/LED per Meter NeoPixel Strips (https://www.adafruit.com/product/1138) I think I purchased these in 2014 from your guys. The project did not work, no LED's would light. As soon as I back rev'ed the Library to 1.0.0 it started working fine.

I am initializing the strip like this, and calling it in this fashion. Is it just a "Stupid User Trick that I am doing wrong?

Code: Select all | TOGGLE FULL SIZE
//Settings:
#define PIN 3                   //The Pin out your Neopixel DIN strip/stick is connected to (Default is 6)
#define TPIXEL 46               //The total amount of pixel's/led's in your connected strip/stick

//To change the timing of between pulses change the number in int 'refresh', to change the speed of it scrolling change the number in int 'wait_T' and 1000 is equal to 1second.
int wait_T          = 40;       //This is the delay between moving back and forth and per pixel
int refresh         = 400;
int PixelCount      = 46;       //Set this to the AMOUNT of Led's/Pixels you have or want to use on your strip And It can be used to tell where to Stop then return the eye at in the strip
int Pixel_Start_End = 0;        //Set this to where you want it to Start/End at
boolean UsingBar    = false;    //Set this to true If you are using the 8x1 Neopixel Bar Or you want to only use 3 leds for the scanner.

Adafruit_NeoPixel strip     = Adafruit_NeoPixel(TPIXEL, PIN, NEO_GRB + NEO_KHZ800); //Standard Strip function



void loop()

case 1:
        {
            ColorWipeWithButtonCheck(strip.Color(11, 222, 222), 0); //Default Blue for Animation.
            strip.show();
        }


boolean ColorWipeWithButtonCheck(uint32_t c, uint8_t wait)
{
  int     tmpButtonState = LOW;
  boolean bAbnormalExit  = false;
 
    for (uint16_t i = 0; ((i < strip.numPixels()) && (false == bAbnormalExit)); i++)
    {           
            strip.setPixelColor(i, c); 
            strip.show();
            delay(wait);     
      tmpButtonState = debounceRead(BUTTONPIN);
            if ((tmpButtonState != buttonState) && (HIGH == tmpButtonState))
            {
                bAbnormalExit = true;
                break;
            }
            else
            {
         

            bAbnormalExit = DelayWithButtonCheckColorWipe(3);
            }
    }
    return (bAbnormalExit);
}

joshuakane
 
Posts: 256
Joined: Sat Apr 13, 2013 4:40 pm

Re: NeoPixel Library version 1.1.1 Quesion

by joshuakane on Tue Jun 13, 2017 12:51 pm

Here is something interesting. It seems I can reproduce the behavior on my Trinket, but not on the Uno I test with. It seems that there is something that the trinket (5v) is not liking about the library update

-- Joshua

joshuakane
 
Posts: 256
Joined: Sat Apr 13, 2013 4:40 pm

Re: NeoPixel Library version 1.1.1 Quesion

by joshuakane on Tue Jun 13, 2017 1:02 pm

Mystery solved, it was a "Stupid User Trick"

with the code I was using, I was trying to initialize a strip and use it twice. I never implemented that function and the 1.0.0 code must have ignored it. The newer 1.1.1 code "tripped" over it.

The first init was the offending line, removing it resolved the issue.
Code: Select all | TOGGLE FULL SIZE
Adafruit_NeoPixel pixels    = Adafruit_NeoPixel(48, PIN);
Adafruit_NeoPixel strip     = Adafruit_NeoPixel(48, PIN, NEO_GRB + NEO_KHZ800); //Standred Strip function

joshuakane
 
Posts: 256
Joined: Sat Apr 13, 2013 4:40 pm

Please be positive and constructive with your questions and comments.