Note: This library is actively improved and modified based on the official Waveshare STServo control library. Enhancements, bug fixes, and new features are added for better usability and reliability. Control your Waveshare STServos easily with Python! This library provides both a simple GUI application and a powerful programming interface for STServo control.
- 🖱️ GUI Control: Point-and-click interface - no coding required!
- 🔍 Auto-Discovery: Automatically find and connect to your servos
- 🎯 Precise Control: Move servos to exact positions or run them continuously
- 📊 Real-time Monitoring: See servo status, load, and position live
- 🔧 Easy Setup: Simple installation and configuration
- 👥 Multi-Servo: Control multiple servos at once
# Navigate to the project folder
cd waveshare_stservo_python
# Install the package
pip install -e .
- Connect your STServo to your computer via USB-to-TTL adapter
- Note the serial port (usually
/dev/ttyACM0
on Linux,COM3
on Windows)
stservo-gui
That's it! The GUI will open and you can start controlling your servos immediately.
The GUI is the easiest way to get started:
- Launch: Run
stservo-gui
in your terminal - Connect: The app auto-detects your serial port
- Discover: Click "Scan for Servos" to find connected servos
- Control: Use sliders and buttons to move your servos
- Monitor: Watch real-time position, load, and temperature data
- 🔍 Automatic Servo Detection - finds all connected servos
- 🎛️ Position Control - precise angle positioning
- 🏃 Speed Control - set movement speed
- 🔄 Wheel Mode - continuous rotation
- 📈 Live Monitoring - real-time servo data
- ⚙️ Settings - change servo IDs, limits, and calibration

We've included lots of examples to help you learn:
# Move servo with ID 1 to position 500 at speed 2000, timeout 20s
python -m examples.control.move_to_position --port COM3 --servo-id 1 --speed 2000 --timeout 20 500
# Test connection to your servo
python -m examples.discovery.ping_all
# Toggle servo torque
python -m examples.advanced.torque
Edit config/device_port.yaml
to match your setup:
device_port: "/dev/ttyACM0" # Linux/Mac
# device_port: "COM3" # Windows
MIT License - use it freely in your projects!
Pull requests welcome! Help make this library even better!