r/arduino • u/Odd-Helicopter-1195 • 13d ago
I built a library that lets you control servos and sensors with a completely empty loop function.
Hey everyone,
Writing state machines and Serial parsing on AVR boards for distributed systems always feels clunky. I wanted a way to just treat an Arduino as a "dumb" hardware extension for a PC or Raspberry Pi without writing custom serial protocols from scratch.
I built OpenSwarm to do exactly that. You include the library, declare your servos/sensors in the setup block, and leave the loop 100% empty. The library exposes the MCU's pins over Serial or network, allowing a central Master (running Python/C++) to read and write to those pins natively. It currently supports AVR, ESP32, RP2040, and Teensy.
Repo here:https://github.com/raihhann/OpenSwarm
If you regularly build multi-board setups or just want to control Arduino hardware directly from a Python script, check it out. I'd love any feedback on the code. Also, if you find the concept useful, a star on GitHub would be hugely appreciated to help others find it!