Mini Maestro MicroPython support

Hi,

I’ve been using this 6 channel module for a long time on a panoramic robot that is controlled with an Arduino and a Touch-Slide.
I’m upgrading my panoramic robot and want to make things simpler and smaller. I started developing the panoramic robot with the small and powerful Pi Pico in MicroPython. I know it is possible to control the servo with the Pi Pico directly, but my experience with that is that its very difficult to control the ramp-up, ramp-down and speed of the movements, making it a very jerky moving pano-bot that overshoots the target angle or even moves while shooting.
The idea is to use this old trusty Mini Maestro again to overcome these issues … but there is no library to be found. So I’m looking for example code/library of MicroPython to control the servo’s with the Pi Pico.
Is there any example code available ?

Hello.

Unfortunately, we do not have any kind of libraries or support for the Maestro in MicroPython. However, you could try writing your own implementation of the serial commands. For example, here is a simple MicroPython script that shows how you could write a set_target function:

from machine import UART
from time import sleep

uart = UART(0, baudrate=9600)

def set_target(channel, position):
    cmd = bytearray([
      0x84,
      channel,
      position & 0x7F,
      (position >> 7) & 0x7F,
    ])
    uart.write(cmd)

while True:
    set_target(0, 4000)
    sleep(1)
    set_target(0, 8000)
    sleep(1)

By the way, the Raspberry Pi Pico is 3.3V and the Maestro is 5V, so you should probably use some kind of level shifter between them to avoid potentially damaging the Raspberry Pi Pico.

Brandon