{"id":30117031,"url":"https://github.com/alecxcode/stepper","last_synced_at":"2025-08-10T10:35:57.384Z","repository":{"id":306285151,"uuid":"1002199289","full_name":"alecxcode/stepper","owner":"alecxcode","description":"Stepper Motors for Raspberry Pi gpiozero","archived":false,"fork":false,"pushed_at":"2025-07-24T20:17:58.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-24T21:07:13.348Z","etag":null,"topics":[],"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/alecxcode.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,"zenodo":null}},"created_at":"2025-06-14T23:44:54.000Z","updated_at":"2025-07-24T20:18:01.000Z","dependencies_parsed_at":"2025-07-24T21:07:17.802Z","dependency_job_id":"2e7462c2-591f-4e97-a9e0-3ab70640300b","html_url":"https://github.com/alecxcode/stepper","commit_stats":null,"previous_names":["alecxcode/stepper"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/alecxcode/stepper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecxcode%2Fstepper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecxcode%2Fstepper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecxcode%2Fstepper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecxcode%2Fstepper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecxcode","download_url":"https://codeload.github.com/alecxcode/stepper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecxcode%2Fstepper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269712143,"owners_count":24463207,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-10T10:35:55.331Z","updated_at":"2025-08-10T10:35:57.369Z","avatar_url":"https://github.com/alecxcode.png","language":"Python","readme":"# Python Stepper Motor Controller\n\nA lightweight Python class for controlling stepper motors using GPIO on a Raspberry Pi via the `gpiozero` library. Supports 2-pin, 4-pin, and 5-pin motors.\n\nIt essentially implements the same `Stepper` class logic as described in the [Arduino Stepper library](https://docs.arduino.cc/libraries/stepper/).\n\n## Features\n\n- Compatible with 2-pin, 4-pin, and 5-pin stepper motors  \n- Forward and reverse movement  \n- Adjustable stepping delay (speed)  \n- Arduino-style stepping logic  \n- Easy integration with `gpiozero`\n\n## Requirements\n\n- Raspberry Pi with GPIO  \n- Python 3.9+  \n- `gpiozero` library\n\n## Video Tutorial with Electronics\n\n[![Video Tutorial](https://img.youtube.com/vi/T8thjPohz5g/mqdefault.jpg)](https://www.youtube.com/watch?v=T8thjPohz5g)\n\n## Installation\n\nPlace the `stepper.py` file containing the `Stepper` class in your project directory.\n\nInstall dependencies if not already available. For example:\n```bash\npip install gpiozero\n```\nor\n```bash\nsudo apt install python3-gpiozero\n```\n\n## Usage\n\nInitialize the object (example for 4-pin motor with 2048 steps):  \n`step_motor = Stepper(2048, 5, 6, 13, 19)`\n\nSet the motor speed in rotations per minute (RPM):  \n`step_motor.set_speed(8)`\n\nMove the motor one step forward:  \n`step_motor.step(1)`\n\nMove the motor one step backward:  \n`step_motor.step(-1)`\n\nStop the motor immediately:  \n`step_motor.stop()`\n\n## Example\n\n```python\n# 4-pin Stepper Motor on Raspberry Pi\nfrom time import sleep\nfrom stepper import Stepper\n\nstep_motor = Stepper(2048, 5, 6, 13, 19)\nstep_motor.set_speed(10)\n\ntry:\n    while True:\n        step_motor.step(1024)\n        print(\"rotated half\")\n        sleep(2)\n        step_motor.step(1024)\n        print(\"rotated half more\")\n        sleep(2)\n        step_motor.step(-1024)\n        print(\"rotated half back\")\n        sleep(2)\n        step_motor.step(-1024)\n        print(\"rotated half more back\")\n        sleep(2)\nexcept KeyboardInterrupt:\n    pass\nfinally:\n    step_motor.stop()\n```\n\n## Help the Creator\n\nIf you find this useful, consider supporting the developer.\n\n[![Donate](https://exoimages.pages.dev/buttons/donate-ora.svg)](https://www.gofundme.com/f/keep-my-science-journey-alive-with-support)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecxcode%2Fstepper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecxcode%2Fstepper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecxcode%2Fstepper/lists"}