Trouble running 210 LED NeoPixel Strand via Arduino Uno and Serial

Coming from years of using Max so I’m noodling my way around the different ops figuring stuff out.

So far I’ve been able to setup two way communication between TD and Arduino. Following this tutorial on interfacing with NeoPixels from Immersive and __ HQ: https://www.youtube.com/watch?v=8J2WSOWAyTs

In that tutorial the resolution of the data being sent via serial to the arduino is done via a constant of 10 pixels since in the example they are working with a Circuit Playground Express.

Like I mentioned in my title I’m trying to run 210 NeoPixels. They are setup inside of a icosahedron infinity box.

I can get the LEDS to update but only up to a certain point. So at 20-30 LEDs it runs decent, 40 it slows down (maybe 1-2 “frames” second), and then at anything above 40 the LEDs don’t even turn on.

Here is my TD network:
td_LED_duplicate.toe (8.0 KB)

And here is my Arduino sketch:
td_LED_communication.zip (1.1 KB)

*These are both pretty much the exact same as what’s in the tutorial.

This is a project I’m doing for a little local art demo night as a way to wet my feet in TD. I have another infinity box in the shape of a dodecahedron and ideally I would be able to run them both on one (or two) serial ports/arduinos and have them be interactive via an ultrasonic distance sensor that updates some TD values to change the look of the LEDs.

My first assumption is that processing the serial data int by int with a for loop is the thing that is slowing this all down. I’m doing some research into processing and storing the serial data in an array rather than a string. Additionally I would like to have much smoother led transitions a la FastLED noisePalette.

Thanks for your help in advance and excited to jump in!

Also, quickly dove into the SerialDAT documentation and maybe a solution exists in the difference between sendBytes() and send(). However, I’m a little unsure of the practical difference if someone could explain that.

Hi @jbillauer,

a combination of increasing the baud rate on the arduino side and devising a protocol for the arduino to process bytes instead of strings could speed up the process.

You could also try to sending hex values and a message end delimiter you are checking for. This way you can step forward more easily instead of searching for delimiters like ,

cheers
Markus

Ok, I’ll bump it up to 115200 and see what that does.

As far as processing bytes instead of strings, do you know of any good resources/tutorials for that?

I also, found through one of Lucas’ downloads on his LED post that TD can only do 255 bytes out via serial. I’m thinking that if I’m sending 3 values(r,g,b) for 210 leds then I’ve already surpassed that capability. Is that right?

Hi @jbillauer,

i would have to refer you to the arduino forum for more insight into best approaches of processing incoming data.

Regarding the 255 bytes - could you link to the post? There was a bug at some point but if it’s this one:

then that was fixed back then.

cheers
Markus

It was in one of the text operators in the .toe that Lucas linked in this post from 2014 so I assume it’s probably the same bug you are talking about.

https://forum.derivative.ca/t/hitting-bottleneck-controlling-close-to-4-000-leds/5909/9?u=jbillauer

“Write serial out directly from touch. Not neccesarily the most efficient, touch’s serial communication is limited to packets of no larger than 255 bytes…”

Will report back, thanks!