← PROJECTS/ST3215 SERVO LIBRARY·2024 · 11 · 20feat

v1.2 — async/await support added. Concurrent multi-servo commands now non-blocking.

v1.2: Async Support

Added async/await support throughout the library. Concurrent position commands to multiple servos now run in parallel, reducing command latency from O(n) serial to ~O(1) parallel.

# Before: 12 × ~1ms = ~12ms per control tick
for servo_id, pos in commands:
    servo.set_position(servo_id, pos)

# After: all 12 in ~1.2ms
await servo.set_positions(commands)

The UART bus is still physically serial — the speedup comes from overlapping the software-side latencies (direction switching delays, response parsing) across multiple pending commands.

Backward compatible: all synchronous APIs still work.