Hi
I have total of 20 CRGBset like
CRGBset stripone(leds(0,29))
CRGBset striptwo(leds(30,59))
.
.
.
CRGBset striptwenty(leds(570,599))
I would like to show colordata on stripone and then copy to all other CRGBset at the same time
Void Showcolor (){
Stripone = colordata;
Striptwo = colordata;
.
.
.
Striptwenty= colordata;
FASTLED.show();
}
How I can copy One strip colordata to another with less coding?
Please advise
Thanks
Ken_White
(Ken White)
October 17, 2017, 8:37pm
2
@Neo_Maximus - To do what you are trying to do, you can put your CRGBSets in an array and use a “for” statement to copy the data to each array element. See the following to see how to create an array of CRGBSets and see the CD77_arrayfill() function :
@Ken_White
Thank you for your time.
This is exactly what I want
Also I have a question
FASTLED.delay() used in the example is a blocking delay or non blocking?
Ken_White
(Ken White)
October 18, 2017, 11:51am
4
@Neo_Maximus - I am glad this works for you. I am not sure what you mean by blocking delay and non blocking delay. Are you talking about interrupts?
You can replace delays in a sketch by using the EVERY_N_MILLIS function or other Every_N functions. @Andrew_Tuline is an advocate of not using delays in a sketch and replacing them with EVERY_N functions. He has a good tutorial on this at:
/* every_n_example
*
* By: Andrew Tuline
*
* Date: February, 2017
*
* This demonstrates how to use the EVERY_N_MILLISECONS function with a variable timer.
*
* It just moves an active LED up the strip in accordance with a timer that changes as a sine wave.
*
*/
#include "FastLED.h" // FastLED library.
#if FASTLED_VERSION < 3001000
#error "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define qsubd(x, b) ((x>b)?b:0) // Clip. . . . A digital unsigned subtraction macro. if result <0, then x=0. Otherwise, x=b.
This file has been truncated. show original
Also, see my sketch showing how to do this at:
marmil
(Marc Miller)
October 18, 2017, 4:13pm
5
@Ken_White
+Marc Miller
Thank you
Having any idea to make a radar scanning kind of pattern ?
As I mentioned earlier I am using 20 CRGset of led APA 102(each set 30 pixels)
I tried with Sinelon example which move a dot with fading trial
How can I do the same effect if the CRGBset leds are arranged to form a circle
Each CRGBset will rotate with fading trail.
Thanks
Ken_White
(Ken White)
October 19, 2017, 11:19pm
7
@Neo_Maximus - you might try a different approach to a radar scanning animation. Look at @Sean_Clohesy 's radar sketch at:
https://plus.google.com/+SeanClohesy/posts/2BSgqDkncS6
also see a couple of the functions in my sketch based on @Jason_Coon 's tree code at:
https://plus.google.com/102004717133653297761/posts/1XeG3sKGu9z
This might be of help to you.
@Ken_White
How I can mirror one CRGBSet to another.
I tried like this.
CRGBset stripone(leds(0,29)) // normal - d
CRGBset striptwo(leds(59, 30)) // mirror -
But not working the way I want.
Any idea?
marmil
(Marc Miller)
October 21, 2017, 9:54pm
9
I tested out mirroring a bit here:
// Marc Miller, Oct 2017
#include "FastLED.h"
#define NUM_LEDS 32
//CRGB leds[NUM_LEDS]; // Not using this. Using CRGBArray instead.
CRGBArray<NUM_LEDS> leds;
CRGBSet partA(leds(0,NUM_LEDS/2-1)); // First half of strip.
CRGBSet partB(leds(NUM_LEDS/2,NUM_LEDS-1)); // Second half of strip.
//---------------------------------------------------------------
void setup() {
delay(500);
FastLED.addLeds<LPD8806, 11, 13, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(255);
}
//---------------------------------------------------------------
This file has been truncated. show original
@marmil
Hi
I have used some codes from demoreel and some from your CRGBSet example.
I have posted the code (My Appication has 20 CRGBSet, but for testing i have made only 6 CRGBSet)
I wanted to move a dot on Strip_1 in forward direction and on Strip_2 in reverse direction
please look at line 34 and 35 , if i uncomment line 34 dot on strip_2 is moving forward
If i uncomment line 35 to make reverse movement it is not happening
As i understand the below line is equal to CRGBSet Strip_2( leds( 47, 24));
So in CRGBSet Strip_2, led(47) is equal to led(0) am i right?
CRGBSet Strip_2( leds((pps-1)+(pps1), pps 1 ));
please advise where am i making mistake.
marmil
(Marc Miller)
October 22, 2017, 2:46pm
11
Hmmm, I don’t see why it’s not working. Maybe just work with pixel numbers until you sort it out, and then replace with the pps formulas later.
@marmil
Yes I did. I used pixel number also instead of pps.
Same issue.
CRGBSet Strip_1 (leds(0, 23));
CRGBSet Strip_2 (leds(47,24));
Any Idea?