Hi people, I’m new to this whole arduino and led thing and had been watching from the sidelines for sometime trying to pluck up enough confidence to give it a go. Whilst most of your own videos blow me away with what can be achieved with some understanding of coding - the absolute basics still elude me. My first project is to make my children a night light for their bedroom. So I have brought 4 meters of APA102 and a 5v 16Mhz pro mini. I have managed to upload test code with little problems so I know I have wired correctly.
My question is this, how can I make the strand of LED’s display RED and with delay perhaps turn BLUE or any other color of their choosing?
I recommend that you play around with several of the examples that are provided with FastLED. Also have a look at the documentation and other examples you can download and play around with.
After a while, you’ll find it’s pretty easy to start off with a solid red strand of LED’s and blend them to blue using one of the FastLED functions (err, the blend function).
Oh, and my very first project was to blink a red LED.
Hi Andrew, yeah I have been playing about with the demos but because they all seem to dance around or blink, change colour, I cant determine anything that says LEDs all go red (dont flash, dont strobe, dont fade… just be Red)
Dont like failing at the very first hurdle, but I’m sure it will become clearer as time goes by. Oh and I think your slideshow that I have just looked through may hold some answers for me!
Okay I have found some code on the basic usage of FastLED which allows individual setting of LED’s to be whatever color I choose.
leds[0] = CRGB::Red;
FastLED.show();
delay(30);
Instead of me changing leds[0} to [1], [2], [3] etc… is there a command I can use that will take my whole strip and make it all red or should I have to type 240 lines of code similar to above.
I have tried substituting leds[0] = CRGB::Red; to NUM_LEDS = CRGB::Red; as I have 240 defined at the start of the code but it throws an error message to which I dont understand?
Mark many thanks for the pointers. I see in alot of code things like for( int i = 0; i < NUM_LEDS; i++) {
leds[ i ] = CRGB::Red;
Does the Wiki also have details on things like making a loop and code definitions such as ‘int’ and ‘i++’ ?
Got a feeling this new found hobby is going to become a journey!
That stuff is all part of the standard Arduino programming environment, which uses the C (or “C++”) programming language, about which much has been written!
Maybe check out the Foundations section of the Arduino site, http://www.arduino.cc/en/Tutorial/Foundations , or look around for another “getting started with Arduino programming” sort of tutorial. That should help with the basics!
Also, I’ve been pleasantly surprised at how often I find the snippet of code I need when I google what I’m after. For example, FastLED WS2812 turn all leds one color at once.
I’m just getting started myself and compare it a lot to my newbie quadcopter journey – the most fun you’ll ever have being frustrated.
Five seconds of the LEDs blinking the way you want them to makes up for the five days of head-banging it takes to get there.
Hi @Dave_Slater , I started with arduino not so long ago and found quite a few very helpful tutorial videos on YouTube. Just look for ‘arduino tutorial’ many are intended for the real beginner !