r/FastLED • u/Fluffy-Wishbone-3497 • Apr 18 '26
Discussion syncing fastled
I've got 3 bigger matrices that i want to compare side by side running a FastLED sketch (flowfields/colortrails). Two are teensy4.1's and one is an esp32-p4. Is there a way I could use to get the sketches to start at the same time or sync up somehow? One teensy is just running on a power supply, only a joystick input to change the patterns. The other two are hooked up to laptops. They're all within a few feet of each other right now. (I've tried to reset them all at the same time but eh, it doesn't go so well!) I'm using the PARLIO branch of FastLED on all three.

2
u/StefanPetrick Apr 21 '26
You could connect one microcontrollers output pin to input pins of the other controllers and have them all 3 start the program once "the button is pressed". It could be any free pin and a simple digitalread() and digitalwrite() call.
5
u/dr-steve Apr 18 '26
I wrote TaskManager (TM) around 10-12 years ago to handle cooperative multitasking on Nano systems. It supports cross-node/mesh networking; RF24 on Atmel systems. It also runs on ESP-32 systems (five years ago? Maybe more?) and uses ESP-NOW for communication. This allows cross-task messaging and control. I've built 40-node simulations using ESP-32 systems.
Recently, I've been experimenting with virtual clocks. One node runs a master-clock task, and all TM tasks will use the same millisecond virtual clock. This allows me to create large time-based simulations with separate nodes controlling different areas of the grid.
I haven't played with Teensy systems at all, though. DM me a note if interested. It could solve a number of your problems using simple messaging (joysticks on one system sending info to other systems -- "Send this message to task 23 on node 18", where the message can be any 250 byte block of data) as well as synchronizing the clocks used by different simulations.
DM me if you'd like to explore. I'd be interested to see what porting to the Teensy looks like.
1
u/Moyo442 Apr 18 '26
Do you have serial connections to the two that are connected to the laptop? Maybe you could implement a trigger that you send to both simultaneously (potentially using a small script) and try to time that manually with the joystick? Maybe that's enough if you only need to sync it once or twice to compare. For a more permanent solution I think you would have to set up a network. Not sure about the simplest way but maybe a server that's hosted on your laptop, which the nodes connect to and wait for a simultaneous trigger. Have you already got Wi-Fi set up on the controllers?
1
u/mag_man Apr 18 '26
OMG, that big one on the wall is impressive!
1
u/mindful_stone Apr 20 '26
I'm curious about what you mean by "sync up" or what starting them at the same time would do. Given that the FlowField visualization is largely noise-based, won't they all be doing their own thing?
1
u/DeVoh Apr 18 '26
or maybe with using a ntp library to all start at a certain time.