I'm making a pile of single-DOF joint controllers based on Arduinos, and one of the functions I haven't found is a basic realtime library. We have interrupts, which is good, but we also need functions that provide deterministic timing. Here's an incredibly basic implementation of that. I wrote a simple delay function that I needed for an SPI device that must be read at a specific frequency. It doesn't provide interrupts to cancel running processes (speed up), but will delay the control loop to maintain a standard update rate (slow down). Will add features as developed.
<removed>
<removed>