So, I’ve played around a pretty fair amount with FastLED on the WS2811. I know just enough to be dangerous. But, given eons of time, I can usually throw together some goodies for various holidays.
I bought a couple of strands of APA102 60/meter. I want to use FastLED to program them. I’m trying to get them programmed to show flash a group of 10 or so red leds, quickly followed by 10 white, and then 10 blue, all going quickly down the strand.
My current code flashes Red, Blue, Green. All I want is to change the Green to White.
I’ve attached the code at this link so it doesn’t clutter up your screens.
Thanks a ton for responding @Mike_Thornbury ! I tried to run the RGB Test sketch, figuring that might help. But, that sketch is designed primarily for the ws2811, not the apa102. In the sketch when I invoke the strip definition, it won’t run because (I guess) the led strip definition isn’t right. In my attachment here, this seems to work:
The RGBCalibrate code doesn’t specify how to do that for the apa102 that I can see. As I went through the example code for FastLED on github, I found there were sporadic comments on how to make FastLED works with apa102-like devices. But, there wasn’t any uniform discussion or examples for working with FastLED and the apa102. I’m happy to write something apa102 specific instructions if I could reliably extrapolate or figure out how it works.
I’m not trying to be critical on that, either. The Dotstar is still pretty new.
PS: @Mike_Thornbury . Your prodding helped! When I tried to run the RGBCalibrate sketch before, it refused to compile. Thankfully, I can now get it to compile, but it 1) doesn’t light just six lights (there are 60 on the strip, and probably 2/3 are lit), 2) the first two are unlit, 3) some of them are lit Yellow (versus RG or B). The GitHub RGBCalibrate.ino sketch doesn’t specifically define the apa102: that may be part of why it’s not working.
You have to make the definition. Some of the sketches pre-date the APA102, so the chipset won’t be in the example. And all sketches are for all chipsets -if the chipset is defined in FastLED, it will run all the sketches, MCU permitting.
Well, @Mike_Thornbury , isn’t that just embarrassing. I’d been trying so hard to find something that I thought might work that I guess I missed that. Maybe that’s why it didn’t compile! It’s the first thing I’ve gotten to work on these Dotstars after trying a bunch of things.
So, @marmil I can probably ask more knowledgeable questions now.
You are using APA102s, but didn’t select the APA102 option straight above it, but used ‘DOTSTAR’ - they may be the same, but there are two categories of definition for a reason. If you bought Dotstars’ from Adafruit, use that definition, but if you didn’t, use APA102.
You are using a controller that has a data and a clock pin, but your #define for a clock pin is commented out. That’s never going to work.
What version of Arduino IDE are you using? What version of FastLED are you using?
FWIW, I am using Arduino 1.6.5 and FastLED 3.1. Lots of versions of Arduino will work, but you should be using FastLED 3.1 - I’m not sure other versions have APA102 support.
Turn on compiler debugging so you can see what’s causing your compiler to stop.
There is a bug with the 1.6.4 arduino IDE where it will sometimes freeze on compile, upgrade at least to 1.6.5. (Also, DOTSTAR and APA102 are in fact the same thing in the library - there’s two definitions to allow people to refer to them how they wish)
@Mike_Thornbury Thanks, for your responses. I was trying hard to get something working for the 4th so reverted to some old neopixels and got them going.
I’ve been busy working at the hospital the past couple of days. I’ll try the Dotstars again asap. I’m sure you’re correct about the commenting out the Clock pin. I think I must have done that after I posted the original code and that’s why it’s now screwing up (I wondered what happened there because the Fire2012 sketch was running so beautifully. I thought - oh, crap - I just burned out my new Dotstars. It’s always something little with these kinds of things unless you do it all the time.
Also, I’ll recheck the version. I’m still getting used to GitHub. It’s possible I wasn’t using the latest. GitHub has a certain voodoo quality for me. It’s getting better though. Anyway, thank you very much.
@Daniel_Garcia Thanks so much for your response. The APA102 and Dotstar settings were confusing to me. I understand better now. I am using 1.6.5 and update the IDE anytime there’s a new version. The reasoning for doing that is even clearer to me. I appreciate your time.