DevLog #1 – servo-like-arduino
Time Logged: 1h 8m
Today I began development of servo-like-arduino, a Python library designed to provide Arduino-style servo control syntax while using PyFirmata2 and StandardFirmata behind the scenes.
The project started from a desire to control servos connected to an Arduino Nano from a Raspberry Pi while maintaining a familiar Arduino programming experience.
After evaluating both PyFirmata and PyFirmata2, I chose PyFirmata2 due to better compatibility with modern Python versions and because it worked without requiring users to manually modify library source files.
The first milestone was creating a simple wrapper around PyFirmata2. This wrapper hides Firmata-specific syntax and instead exposes a cleaner Arduino-inspired API. The goal was to make servo control feel similar to programming directly on an Arduino (which is very simple as compared to the default PyFirmata and PyFirmata2 syntax) while still running Python code on a Raspberry Pi.
Once the basic functionality was working, I implemented a global board system so that users would not need to repeatedly pass board objects into every function call. This made the library feel much closer to Arduino’s native Servo library and simplified the user experience.
After the initial release (v0.1.0), I expanded the functionality for v0.2.0 by adding several new features:
Servo.read()
Servo.detach()
Servo.move_smooth()
Servo.sweep()
Improved error handling
Servo angle validation and clamping
Internal servo position tracking
A significant portion of the development process involved testing on real hardware. The library was validated using a Raspberry Pi 4 connected to an Arduino Nano running StandardFirmata, with a servo motor attached for testing. This ensured that the library worked correctly in a practical robotics environment rather than only in theory.
Following successful testing, I packaged the project using modern Python packaging standards with pyproject.toml, created a GitHub repository, and configured automated publishing to PyPI using GitHub Actions.
The most exciting milestone of the session was successfully publishing the library to PyPI. By creating a GitHub Release, the workflow automatically built and uploaded the package, making it publicly installable through pip. This established a complete development, testing, and deployment pipeline for future releases.
This session transformed the project from a simple idea into a functional, publicly available Python package with real hardware validation and automated deployment.
Future development will focus on improving the servo control experience by adding more advanced servo-related features, refining the API, improving reliability, and expanding the library while maintaining its simple Arduino-inspired programming style. The goal is to provide the easiest and most intuitive way to control servos from Python using Arduino boards flashed with StandardFirmata program.
(The Image shows Servo motor and N20 motors (via the TB6612FNG motor driver) connected to an Arduino Nano, which is then connected to a Raspberry Pi, and this was the setup I used to test this wrapper)