DotStar (APA102C) led strip problems/questions

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
xl97
 
Posts: 201
Joined: Mon Jul 27, 2009 12:51 pm

DotStar (APA102C) led strip problems/questions

Post by xl97 »

I have a 144/meter DotStar (APA102C) led strip:
https://www.adafruit.com/product/2328

I originally was trying to work with Neopixels... but with the current proejct, I am also using a serial .wav/.mp3 player, so having the tight timing requirements of the Neopixel leds/library... (and that it turns off interrupts..etc).. I was getting odd behavior... (missing audio upon button state changes..etc)..

So I decided to try some DotStars instead..(to at least eliminate that being an issue and pointing back to my terrible code!) LOL..

Is it just the constructor that differs from the Neopixel lib? Are all the commands the same?

When I power on my project (Arduino UNO, powered by USB, Aduino board (DFPlayer mini), and the DotStar led strip, powered by benchtop PSU with all GNDS connected)..

The led strip has random LEDS lit up? (I only defined maybe 8 or 12 leds in my tests... but some leds way back in the 144 count are lit up......why?)


When I use the default sketch that comes with the lib on git....

It too has the same problem? While it uploads fine.. and runs the 'color string' up to defined 20 pixels/leds... every led past that is on.. with a light green color in them?

When testing some default made strip patterns.. I see some of the first leds in the strip blink or are odd colors as well.. why?

I have tried using the wipe() function you seem in most demo sketches.. I have tried to just run a loop to set all the color to (0,0,0)...

Why do I have color on leds that are NOT part of the defined NUMPIXEL variable?

This is a currently 'borrowed' DotStar strip.. but from my understanding is new and in mint condition.

For now..

I am just looking to solve these two items (once I have tackled these.. I can loop back for other the features)..

1.) Why does:

This:

Code: Select all

for(byte x=0;x<144;x++){
    strip.setPixelColor(x,0, 0, 0);   
}
or this:

Code: Select all

strip.begin(); // Initialize pins for output
strip.show();  // Turn all LEDs off ASAP
not work to set all leds to black/off/no color?

Or more so.. how can I start with a completely OFF DotStar strip?




2.) How can I get a NON-blocking fade pattern going? (my current sketch is a FSM/state machine.. and I dont want to use delays or be stuck in a 'pattern loop', as I need to constantly check for user interaction (buttons..etc)

I currently have my # of pixels just set to turn all one color, to display (visually) the state the code is in..

* power on (state #1)
* which should immediately/automatically shift to state #2 (looped thrust sound clip after detection of power on clip is complete)
* power down (state #3)

So when I press the button.. I set all leds to red
which upon detection of power on clip being complete (and the button is STILL being pressed).. change the leds to blue
when the button is released, I am changing the leds to green.

This all seems to be working.. (except that are other leds in the strip that lit up!!! The led immediately my delcare # leds is on.. Id say maybe anohter 30-40 leds away.. another '2' are on...

these are displaying a WHITE color as well..


Here is some trimmed down code to show my FSM approach... and how I am implementing the patterns (normal tutorial approach).. however I left out my failed attempts at non-blocking fade in or out functions... (since we are not supposed to use setBrightness().. and none of them worked anyways!) LOL

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”