Creating a queue in Arduino?
I wrote a simple queue library some weeks ago, you can find it in the arduino library manager, or here:
Queue

I think you need FIFO implementation, but LIFO is also implemented in the lib &amp; possibility to overwrite previous records when full.
It can handle any structure or data type (as long as it's size is fixed for memory allocation), defining a number of records in the queue, then you're good to go.

2 methods are implemented to interact with the queue, push() &amp; pull().
I'll probably add a peek() later on if needed.

I also noticed this other FIFO only queue lib in the library manager when I commited mine: MD_CirQueue

Hope this can help!