{"id":26980075,"url":"https://github.com/frc4564/maestro","last_synced_at":"2025-07-13T01:03:44.336Z","repository":{"id":11878701,"uuid":"14439733","full_name":"FRC4564/Maestro","owner":"FRC4564","description":"Python class to support Pololu's Maestro servo controller over USB serial. Great with Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2020-07-25T22:14:20.000Z","size":109,"stargazers_count":86,"open_issues_count":8,"forks_count":59,"subscribers_count":14,"default_branch":"master","last_synced_at":"2023-10-25T14:16:39.927Z","etag":null,"topics":["control-servos","maestro","pololu","python","raspberry-pi"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FRC4564.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-16T01:50:52.000Z","updated_at":"2023-08-21T04:53:15.000Z","dependencies_parsed_at":"2022-07-20T14:18:56.284Z","dependency_job_id":null,"html_url":"https://github.com/FRC4564/Maestro","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRC4564%2FMaestro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRC4564%2FMaestro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRC4564%2FMaestro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRC4564%2FMaestro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FRC4564","download_url":"https://codeload.github.com/FRC4564/Maestro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247018133,"owners_count":20869957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["control-servos","maestro","pololu","python","raspberry-pi"],"created_at":"2025-04-03T14:29:54.729Z","updated_at":"2025-04-03T14:29:55.393Z","avatar_url":"https://github.com/FRC4564.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿maestro.py\n==========\n\nThis Python class supports Pololu's Maestro servo controller over USB serial. Great for use with the Raspberry Pi, but works with Windows too.\n\nThe class includes methods to control servos (position, speed, acceleration), read servo position, and start/stop Maestro scripts.  See Pololu's on-line documentation to learn about the full capabilities of this nifty micro-controller.\n\n## Setup\n\nPololu's Maestro Windows installer sets up the Maestro Control Center, used to configure, test and program the controller.  Be sure the Maestro is configured for \"USB Dual Port\" serial mode, which is [not the default](https://www.pololu.com/docs/0J40/3.c).\n\nYou'll need to have the 'pyserial' Python module installed to use maestro.py.\n\nIf you have pip available, pyserial can be installed as follows:\n\n    python -m pip install pyserial\n    \nor, for python3\n\n    python3 -m pip install pyserial\n\nAlternatively, you can download pyserial-2.7.tar.gz from http://sourceforge.net/projects/pyserial/files/pyserial/\n\n    wget http://sourceforge.net/projects/pyserial/files/pyserial/2.7/pyserial-2.7.tar.gz\n\n and then install\n\n    tar –zxf pyserial-2.7.tar.gz\n    cd pyserial-2.7\n    sudo python setup.py install\n\nCheck out http://pyserial.readthedocs.io/en/latest/pyserial.html#installation for other install options.\n\nTo download the maestro.py module issue the following command:\n\n    wget https://raw.githubusercontent.com/FRC4564/maestro/master/maestro.py\n\n## How to Use\n\nExample usage of maestro.py:\n\n    import maestro\n    servo = maestro.Controller()\n    servo.setAccel(0,4)      #set servo 0 acceleration to 4\n    servo.setTarget(0,6000)  #set servo to move to center position\n    servo.setSpeed(1,10)     #set speed of servo 1\n    x = servo.getPosition(1) #get the current position of servo 1\n    servo.close()\n\nThere are other methods provided by the module.  The code is well documented, if you'd like to learn more.\n\nFor use on Windows, you'll need to provide the COM port assigned to the Maestro Command Port.  You can identify the port by starting Device Manager and looking under Ports (COM \u0026 LPT).  Here's how to instantiate the controller for Windows for COM port 3.\n\n    import maestro\n    m = maestro.Controller('COM3')\n    \n## Permission issue\n\nIf you find that Linux complains about permissions trying to access the ttyACM device, just add your user to the 'dialout' group by issuing the following:\n\n    sudo adduser $USER dialout\n\nYou'll need to reboot for the change to take effect.\n\n## Going Further\n\nThe Maestro series of controllers can support much more than just servo control.  The PWM-based protocol used to control servos is also compatibile with RC Electronic Speed Controllers (ESCs) to control motor power and direction.  There are many motor controller options available for both brushed and brushless motors.\n\nBeyond servo and motor control, the Maestros can also be used for digital inputs, digital outputs and analog inputs.  The setTarget and getPosition methods support setting and reading values for these extended features.  You do, however, need to use the Maestro Control Center to change the mode of individual channels from \"servo\" to either \"input\" or \"output\".  Read the Maestro documentation on how to properly use these special modes and wire them properly.\n\nI've found that the many capabilities of the Maestro lends itself nicely to robotics.  If you're interested in some robotic applications check out [Basic PiBot](https://github.com/FRC4564/BasicPiBot).  Its a simple framework to get you started with making your own interactive and/or autonomous machines.  The maestro has proven to be rock solid in this applications. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrc4564%2Fmaestro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrc4564%2Fmaestro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrc4564%2Fmaestro/lists"}