Hi folks, I'm wondering if it's possible to change the frequency of APA102 to

Hi folks,

I’m wondering if it’s possible to change the frequency of APA102 to 80 Hz with maybe ~1Hz granularity from 70-90 Hz?

I know that we can set the frequency of the clock pin when setting up the LED but I think it can only go as low as 1 MHz based on the Atmel datasheet (I could be wrong here).

If the above method (of changing the clock pin frequency) is not possible, is there another way to do it?

My experiment is currently I have a motor that is PWM’d at 80 Hz. I’d like to strobe the APA102 LEDs at 80 Hz so I can see the propeller of the motors frozen. I’d also like to be able to slowly increase/decrease the frequency of the strobe for different effects. The control for both the LEDs and motor are from the same Arduino board.

I’m starting to think it might not be possible and I would have to resort to using non-addressable RGB LEDs…

Thanks,
Stephen

Upon more thinking, it might be possible but in a different manner… my motor is controlled through modification of the Atmel Timer 2 settings to generate a ~80 Hz PWM with 10% duty cycle. This will be free-running on its own after setting up which allows me to use the main loop function fully dedicated to the FastLED control. I can simulate a 70-90 Hz strobing effect with appropriate delayMicroseconds() and setting the colors on or off.

So you’re confusing two bits here. The frequency of the clock pin is about the data rate used for writing to the LED’s. You typically want to keep that as fast as possible.

For what you want to do you’d want to drive the line of LED’s at a frame rate of 160hz (to get 80 flashes on per second you’d also need 80 blank frames written out) - this comes out to writing a frame every 6.25ms, alternating between on and off.

I think your mixing the clock frequency used for the data transmission with the Frame per second rate.

It seems to me you need to control the FPS precisely to somewhere around 80 Hz and should not care that the actual data rate is many Mhz !!!

Thanks! Makes sense now! I just hope the delayMicrseconds() doesn’t interfere with the timer 2 code (I have 2 potentiometers connected which will modulate the frequency of the motor as well as its duty cycle).

@Stephen_Co I’d love to see a video of this if you get it working. Cool idea.