{"id":13343793,"url":"https://github.com/inductivekickback/nrf_servo","last_synced_at":"2026-01-24T09:36:13.766Z","repository":{"id":77248147,"uuid":"338531797","full_name":"inductivekickback/nrf_servo","owner":"inductivekickback","description":"Servo implementation that uses the NRFX PWM driver","archived":false,"fork":false,"pushed_at":"2024-01-23T01:17:36.000Z","size":46,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-12T06:33:01.423Z","etag":null,"topics":["driver","ncs","nordicsemi","nrfx","servo","zephyr","zephyr-rtos"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inductivekickback.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-02-13T08:40:14.000Z","updated_at":"2025-02-11T22:00:27.000Z","dependencies_parsed_at":"2024-10-24T07:03:13.074Z","dependency_job_id":"af0d7108-bb31-4d4d-948e-4ce51e4c42b1","html_url":"https://github.com/inductivekickback/nrf_servo","commit_stats":null,"previous_names":["inductivekickback/nrf_sw_servo"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/inductivekickback/nrf_servo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inductivekickback%2Fnrf_servo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inductivekickback%2Fnrf_servo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inductivekickback%2Fnrf_servo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inductivekickback%2Fnrf_servo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inductivekickback","download_url":"https://codeload.github.com/inductivekickback/nrf_servo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inductivekickback%2Fnrf_servo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28723467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["driver","ncs","nordicsemi","nrfx","servo","zephyr","zephyr-rtos"],"created_at":"2024-07-29T19:32:01.077Z","updated_at":"2026-01-24T09:36:13.746Z","avatar_url":"https://github.com/inductivekickback.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a Zephyr RTOS driver for controlling servomotors (servos). It was built from the v2.4.0 tag of the [nRF Connect SDK (NCS)](https://github.com/nrfconnect/sdk-nrf).\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/6494431/108953457-10ee0f00-7620-11eb-92ee-487393d81d06.JPG\" width=\"256\"\u003e\u003c/p\u003e\n\n### About servomotors\nA typical servomotor has 180 degrees of rotation and accepts a PWM signal with a period of 20ms where:\n - A pulse of 1.0ms (5% duty cycle) is 0 degrees\n - A pulse of 1.5ms (7.5% duty cycle) is 90 degrees\n - A pulse of 2.0ms (10% duty cycle) is 180 degrees\n\nHowever, these pulse widths are not standardized so it's not uncommon to find servos where, for example, 0 degrees corresponds to a pulse of 0.5ms and 180 degrees is 2.5ms. If a pulse width is used that is outside of the range of a given servo then the servo's motor can stall, drawing an undesirable amount of current.\n\n### About the driver\nNordic's [PWM peripheral](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpwm.html\u0026cp=4_0_0_5_16) works well with servos. However, mapping individual servos to channels of particular instances of PWM peripherals is a chore. This driver automatically assigns PWM channels to each servo device in the DT so the application doesn't have to. Of course PWM peripherals might be needed for other purposes in the application so access to specific instances can be denied via the CONFIG_NRF_SERVO_ALLOW_PWMX settings.\n\nEach servo device in the DT specifies a pin, initial value (in the range of [0, 100]), a minimum pulse width, and a maximum pulse width. The driver then maps the values in the range [0, 100] to the specified range of pulse widths.\n\n### Using the driver\nThis is an example DT entry in the project's local overlay (e.g. \"nrf52dk_nrf52832.overlay\"):\n```\nservo0: nrf-servo0 {\n    compatible = \"nrf-servo\";\n    pin = \u003c27\u003e;\n    init_value = \u003c50\u003e;\n    min_pulse_us = \u003c1000\u003e;\n    max_pulse_us = \u003c2000\u003e;\n    status = \"okay\";\n};\n```\nThen add the following to **prj.conf**:\n```\nCONFIG_NRF_SERVO=y\n```\nThe init value will be written to the device at startup. New values can be written a particular servo:\n```\nret = servo_write(dev, value);\n```\nor read:\n```\nret = servo_read(dev, \u0026value);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finductivekickback%2Fnrf_servo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finductivekickback%2Fnrf_servo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finductivekickback%2Fnrf_servo/lists"}