Please use http://gist.github.com for sharing code, as it makes it easier to read and line numbers can be referenced.
The reason your additional ledspeed() code is not changing the timing is because EVERY_N_MILLISECONDS can not use a variable time. However, if you use EVERY_N_MILLISECONDS_I the timing can be changed while the code is running. Here’s an example using a changing (variable) timer. See line 58.
The variable time in this example comes from line 62. The random8 part could be replaced with a sin8 or cos8 function for example and then it would give a repeating smoothly increasing/decreasing timer value.
I Have done some changes in the code as you advised.
Please check the link below.
There are two led strip (144pixels) connected to pin 22 and pin52 of arduino mega 2560
if you look at the video link below one strip is enabled
result seems to be ok. but when i enable line 71 of the code to start second strip the led running speed became very slow(say 50% reduced). MEMORY USAGE IS ONLY 10%. Same issue happens if i increase the pixels per channel.
my application requires 530 pixels X 2 channel
Is there any way to simplify the code to maintain the speed to drive more number of pixels ?
There are two led strip (144pixels) connected to pin 22 and pin52 of arduino mega 2560
if you look at the video link below one strip is enabled
result seems to be ok. but when i enable line 71 of the code to start second strip the led running speed became very slow(say 50% reduced). MEMORY USAGE IS ONLY 10%. Same issue happens if i increase the pixels per channel.
my application requires 530 pixels X 2 channel
Is there any way to simplify the code to maintain the speed to drive more number of pixels ?
If you have a Due try it with that. (You would also need a lever shifter with a Teensy 3.2)
This is the recommended lever shifter and the wiring.
Also, if both strips are always going to display the same thing you only need to have one http://FastLED.addleds line in your code. Then have the Data out from the Due go to two inputs on the level shifter, and then the corresponding two outputs go to the two strips.
To answer your question about the Teensy, yes, it is programmed the same using the Arduino IDE. You just need to download Teensyduino from the pjrc website.
There is a fps() function in the code which calculates the frame per second
In the serial monitor I am always getting 57
If the max pixel is set to 530 ( tested with arduino mega)
Normally what is the frame rate required?
Is the function returning the correct value?
If the frame rate value what I am getting is correct ( I read in the forum that more than 30 is fine) then why the running speed is very low (even with the 1ms delay)?
Is there any parallel output function in FASTLED to increase the refresh rate?
I have tried with Arduino Due
But still the maximum speed remain same as Arduino Mega
Also I tried with multiple strip on one array (4strips connected to 4 different pin of DUE)
Library and there is little bit speed increase
which is not enough for my application
Do you have any suggestion to get more speed
Please advise
Thank you
@marmil
I have ordered few APA102 strips
Could you pls advise maximum how many pixels can be connected to one data pin
I have total 1060 pixels to control(maintain full speed of led rotation )
I have two identical channel 530 led each.
Is there any way of controlling both channel
Simultaneously (Same effect).
is it possible to make multiple strip one array for APA102 in Fastled same as I did for wd2812b
Yes, multiple strips can be set up as one array. Doesn’t sound like you need to do that though since the two strips are displaying the same thing.
Set NUM_LEDS to 530 and have just one http://FastLED.addleds line in your code. Split the output from the controller to multiple inputs on the level shifter.
And make sure the LED strips are getting plenty of power.
@marmil
Can I use the same level shifter for DUE to connect APA102
There are two pins used clock and data
How the connection will be with level shifter
Thanks
@marmil
Hi
I am getting APA102C version of led strip
From the supplier . Is it same as APA102 ?
Is it ok to buy? Will it work for my application ?(530 pixels connected to one data pin)
I didn’t find much documentation on the net?
Please advise
Thanks
As long as you use the SPI pins on your controller to connect to your APA102 strip it will default to hardware SPI. SPI pins listed here:
FastLED defaults to setting the data rate for APA102 to 12MHz, but if you get data glitches you might need to reduce it by manually setting it in the addLeds line:
FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER, DATA_RATE_MHZ(10)>(leds, NUM_LEDS);
Or in theory, if everything is working perfectly you can try increasing the data rate. But many setups don’t seem to allow the full speed of the APA102 to be used. Not sure what the key is to be able to use the max speed as there are many factors that might effect it (power, wiring, strip manufacturing quality, LED layout, controller, level shifter, data line length, etc.) But it should be faster then the WS2812B setup.
Thank you
It worked. I got the speed what I want.(better if I get more speed than this)
How do I make trailing effect (also Change the trailing length) at both end of the light bar which is rotating.
Also the white light showing little magenta in it.
Is there any way of getting day light white (6000
Please advise
Just updated
Arduino Mega 2560 is used for the above
Trying to connect with DUE . I have some flickering effect even with less frequency 4 MHz .
The code is not running properly ( light is not giving rotation effect. only the first strip is giving some unwanted flickering effect ) DUE Pin 75-data, 76-clock used .