Hello everyone.  I am new user of FastLED library and I would ask if

Hello everyone.
I am new user of FastLED library and I would ask if I can to do something like that:
http://pastebin.com/WN4N080a

I am building intelligent lightning system in tunnel using WS2811’s and I want to replace RGB, 3 white LED strips. 1st strip as Red channel, 2nd as Green channel and 3rd as Blue channel.
I have got builded circuit increasing 5V after WS2811 to 12V to white led strips, but right now my app has over 300 lines of code but if it’s possible this from my link I can make a loop which delete almost 75% of code lines.

Thank you in advance.
Best regards :slight_smile:

I’m not entirely following what it is you want to do here? So are you saying instead of having 6 RGB WS2812 chips you want to have 18 white leds? or?

I want to have 18 strips 25cm of white leds (typical white led strip) and i need to have better steering this because when someone going through the tunnel it’s measured his distance, turning on needed leds and it’s working (sample):
ws[i+1].b=0;
ws[i+2].r=25;
ws[i+2].g=255;
ws[i+2].b=25;
ws[i+3].r=0;
And this is for leds 6, 7, 8, 9, 10. Better will be when I will able to do a simple loop:
currentLed[i-2]=0;
currentLed[i-1]=25;
currentLed[i]=255;
currentLed[i+1]=25;
currentLed[i+2]=0;
And my question is “am I able to do that?” :slight_smile:
Regards :slight_smile:

Ok - I think i’m understanding what you want to do. Something like this might work - then - https://gist.github.com/focalintent/a9c6960c05fa1700270f

basically casting the leds array to an array of uint8_t objects - then you can just access the array like you describe :slight_smile:

Perfect! Thank you so much! I’m appreciate this :slight_smile: It will really help with organising code and I can delete some 250 lines of code because already i have switch…case construction using 18 cases and have copied 10 lines of code in every case and only one thing which is changed is the index and channel of WS chip :slight_smile:

Thank you one more time :slight_smile:

I’m afraid that is not working.
http://pastebin.com/z7iuCNGu

on line 22 I have following error messages.
http://pastebin.com/fnjrVKmN

Sorry that line should read:

uint8_t leds = (uint8_t)ws;

have you got any idea how to disable -fpermissive flag using Arduino 1.6.5?
I saw it’s possible using Eclipse or another IDE but nothing in Arduino editor

http://pastebin.com/3RHj8rQE

Sorry - the g+ comment system ate my text - the line you want should look like this:

(Also, I would strongly encourage you to take some time to look at the basics of c/c++ - especially pointers, arrays, and type casting)

Thank you so much Daniel. I will take care about my C/C++ basics. :slight_smile:

(I know there’s a lot out there for it - but looking at the things you had questions about/problems with here - it seemed like pointing you at those specific areas as starting points was more helpful than saying “learn C++!” – it’s a thing I struggle with in FastLED. There’s a lot of ways that it is very easy for people completely new to programming to use. However, there’s a lot of ways in which it is fairly powerful and flexible, in ways that really benefit from deeply knowing the language (especially when doing slightly sideways things like this). Maintaining that balance is a constant struggle for @Mark_Kriegsman and myself. That said - one of the things I love in this community is watching people grow and learn and to use one example, someone who was asking basic programming questions a couple years ago is now regularly writing tutorials for adafruit :slight_smile:

Please show off video of your tunnel when you get it working!

Having read a few C/C++ books, by far, my favorite so far has been “C++ Primer, 5th edition” (http://www.amazon.com/Primer-5th-Edition-Stanley-Lippman/dp/0321714113). It doesn’t introduce C++ thorough C as many other books do, but rather humid jumps right into the core of C++ and many of the integral improvements over C.

Every few sentences I get an, “Oh… Now that concept the explained (poorly) in another book makes sense now” moment.

It’s a hefty book, but you’ll end up with an understanding of C++ well enough to create rudimentary desktop applications.

Hello Gents,


Here you got the test how it will be working on these WS’es and 12V LED strips :slight_smile:
The reason of random blinking is using the cheapest HC-SR04 and sometimes it’s crazy :slight_smile:
Regards :slight_smile: