Weird freezes and crashes - NeoPixels and Serial

I'm working on a peripheral controller (Adafruit Metro Mini) to handle a ring of 24 NeoPixels and a pressure monitor with release valve. The code is in it development, and much of it is commented out because I've been trying to isolate my problem to no avail so far. Basically, it should be taking instructions over Serial in the form "ring static x single n", where x is 2, 3, 4, 6, 8, 12, or 24 and n is any 16-bit unsigned integer and changing the pattern of the ring accordingly. Unfortunately, it invariably stops responding after 1 or 2 messages, although a Serial reset can usually fix that. Just now, however, it failed by printing the message "ready" over and over...which is in the setup routine and therefore should only ever happen once. The three files that are relevant here are:

FHK-76.ino (8.5 KB)
Ring.cpp (7.0 KB)
Ring.h (1.4 KB)

I've been wracking my brain here but I cannot for the life of me figure out what's wrong mainly because the results are inconsistent (sometimes it works, sometimes it doesn't, and occasionally I get stuck in an infinite loop of the setup routine). Any help or insight would be greatly appreciated.

these 3 file worked for me (I removed the isReady() condition)
Read the whole input and then use isReady to decide if you should parse it.

FHK-76.ino (8.9 KB)
Ring.cpp (7.3 KB)
Ring.h (1.5 KB)

Consistently? Without failures? Could it be my computer that's screwing up here (Mac OS X 11.3.1 communicating through an external USB-C hub)? In that case, I might have to try running the GUI that connects to the Metro Mini on its ultimate host, a BeagleBone Black.

Well I stopped trying after half a dozen inputs.
Tested on Uno.

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