Here is a ring buffer variant to test also
/* Control a set of solenoids with MIDI
* Note on messages trigger solenoids, and they will be turned off after a certain amount of ms has passed
...
Type: Posts; User: mlu
Here is a ring buffer variant to test also
/* Control a set of solenoids with MIDI
* Note on messages trigger solenoids, and they will be turned off after a certain amount of ms has passed
...
Its not my project, but I agree that this a could be a good way to handle something like 100 solenoids, a number to big for the Teensy pincounts. In this case there would be a solenoid array, or...
I have tested your original code on a Teensy 3.6 and a virtual midi keyboard on MacOS, outputs just connected to led's. With only these 5 possible solenoids its very fast, in order of ten...
With all delays equal and the time always monotonically increasing its a simple queue, I would use a circular buffer with the reference (pointer) to the head which is the next element to remove, and...