{"id":13802373,"url":"https://github.com/redoxcode/micropython-servo","last_synced_at":"2025-04-28T12:09:59.128Z","repository":{"id":65175053,"uuid":"585605210","full_name":"redoxcode/micropython-servo","owner":"redoxcode","description":"A micropython library to control rc servos in a tidy way","archived":false,"fork":false,"pushed_at":"2023-09-27T06:57:12.000Z","size":10,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T12:09:52.260Z","etag":null,"topics":["micropython","servo","servo-motor"],"latest_commit_sha":null,"homepage":"","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/redoxcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-05T15:44:53.000Z","updated_at":"2025-03-25T14:13:08.000Z","dependencies_parsed_at":"2024-10-22T17:24:32.829Z","dependency_job_id":null,"html_url":"https://github.com/redoxcode/micropython-servo","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"7264ff81f7b995135d2ef89f399a6f5b76f98a8d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redoxcode%2Fmicropython-servo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redoxcode%2Fmicropython-servo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redoxcode%2Fmicropython-servo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redoxcode%2Fmicropython-servo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redoxcode","download_url":"https://codeload.github.com/redoxcode/micropython-servo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311332,"owners_count":21569009,"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":["micropython","servo","servo-motor"],"created_at":"2024-08-04T00:01:43.021Z","updated_at":"2025-04-28T12:09:59.100Z","avatar_url":"https://github.com/redoxcode.png","language":"Python","readme":"[![pypi version shield](https://img.shields.io/pypi/v/micropython-servo)](https://pypi.org/project/micropython-servo/) [![pypi downloads per month shield](https://img.shields.io/pypi/dm/micropython-servo?color=brightgreen)](https://pypi.org/project/micropython-servo/)\n## Description\nA micropython library to control rc servos in a tidy way. \n\nThis uses hardware PWM as an efficient way to generate the ouput signal. \nBut therefore servos need to be connected to pins with PWM functionallity.\n\nThe servos can be calibrated using 2 points (min / max position).\nThe default values should work for most servos, but won't set the servo to the exact position, as these values are different for each servo model.\n\n## Examples\n### Move servo\n```Python\nimport time\nfrom servo import Servo\nmy_servo = Servo(pin_id=28)\nmy_servo.write(30)\ntime.sleep(2.0)\nmy_servo.write(60)\ntime.sleep(2.0)\nmy_servo.write(90)\n\n```\n\n## API\n### class Servo(pin_id,min_us=544.0,max_us=2400.0,min_deg=0.0,max_deg=180.0,freq=50)\n- pin_id: id of the pin connected to the servo\n- min_us: minimal pulse width (calibration point 1 / there is no clipping if you try to set the servo to a lower value)\n- max_us: maximal pulse width (calibration point 2 / there is no clipping if you try to set the servo to a higher value)\n- min_deg: minimal position in degrees (calibration point 1 / there is no clipping if you try to set the servo to a lower value)\n- max_deg: maximal position in degrees (calibration point 2 / there is no clipping if you try to set the servo to a higher value)\n\n```write(deg)```\n- move the servo to the given position\n- deg: Position in degrees\n\n```read()```\n- returns the position last set in degrees\n\n```write_rad(rad)```\n- move the servo to the given position\n- rad: Position in radians\n\n```read_rad()```\n- returns the position last set in radians\n\n```write_us(us)```\n- set the pulse width for the servo\n- us: Pulse width in us\n\n```read_us()```\n- returns the last set puls width\n\n```off()```\n- disables the output\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Motion"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredoxcode%2Fmicropython-servo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredoxcode%2Fmicropython-servo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredoxcode%2Fmicropython-servo/lists"}