Non-blocking Code Vs. Dual Core Processor

I know this depends on your personal opinion, so that is what I'm looking for!

I'm working on a project that involves many Arduino nodes with Neopixel (addressable) led strips attached to them. My previous version was based around an ESP8266. Each ESP8266 would receive UDP commands telling them which "animation" to play on its LED strip. This worked fine, but the issue is if the ESP8266 is already playing an animation, it can't receive new commands. This is fine if you plan it out for new commands to only be sent once it is planned for a certain animation to be completed, but in my project this won't always be the case.

I understand that the best way to fix this would be through software. Non-blocking versions of the animations could likely be made, but I feel like this would be extremely difficult. Another idea I had was to use a dual core ESP32 module, with one core constantly waiting for new packets and the other one handling the animation. If a new animation is received, the network core can call a flag to halt the animation.

My question is, which option would be best to pursue further?

It is really not once you get the hang of it. I have posted examples here in the past of the demos that come with the Adafruit and FastLED libraries converted into a state machine form.

And how is the animation code supposed to know when to stop? It sounds like rasing a flag is much the same as pressing a button.
Anyway it seems like a waste of a core to me.

Everything is more complicated by adding more processors.

Posting that receiver code might be a good idea.

ESP32 and freeRTOS with a single core or dual core. My choice. I'm betting a single core of an ESP32 with freeRTOS would do the job.

An ESP8266 with the freeRTOS core or a FSM.

Or a Finite State Machine with other MCU's.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.