{"id":26871347,"url":"https://github.com/codeadamca/spike-motors","last_synced_at":"2025-08-26T06:36:33.188Z","repository":{"id":43389680,"uuid":"511227493","full_name":"codeadamca/spike-motors","owner":"codeadamca","description":"A basic example of using the LEGO Spike motor function.","archived":false,"fork":false,"pushed_at":"2023-08-07T18:09:13.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-08-07T20:04:05.677Z","etag":null,"topics":["lego","mindstorms","python"],"latest_commit_sha":null,"homepage":"","language":null,"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/codeadamca.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}},"created_at":"2022-07-06T17:13:15.000Z","updated_at":"2023-08-07T20:04:05.678Z","dependencies_parsed_at":"2022-07-07T18:01:22.935Z","dependency_job_id":null,"html_url":"https://github.com/codeadamca/spike-motors","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/codeadamca%2Fspike-motors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fspike-motors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fspike-motors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fspike-motors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/spike-motors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429485,"owners_count":20775809,"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":["lego","mindstorms","python"],"created_at":"2025-03-31T07:19:10.902Z","updated_at":"2025-03-31T07:19:11.529Z","avatar_url":"https://github.com/codeadamca.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# LEGO® Spike Hub and the Motors\n\nA Python snippet utilizing the LEGO Spike motors, [MicroPython](https://lego.github.io/MINDSTORMS-Robot-Inventor-hub-API/), and a variety of commands: `start()`, `stop()`, `run_for_seconds()`, and `run_for_rotations()`.\n\n## Sample Code\n\n```py\nfrom mindstorms import MSHub, Motor, MotorPair\nfrom mindstorms.control import wait_for_seconds\nimport math\n\nhub = MSHub()\n\nmotor_a = Motor('A')\nmotor_b = Motor('B')\n\nmotor_a.run_for_rotations(1, 100)\n\nmotor_b.run_for_rotations(1, 10)\n\nmotor_a.run_for_seconds(2, 100)\n\nmotor_b.run_for_seconds(2, -10)\n\nmotor_a.start(100)\nmotor_b.start(100)\n\nwait_for_seconds(2)\n\nhub.light_matrix.write(motor_a.get_speed())\n\nmotor_a.stop()\nmotor_b.stop()\n\nhub.speaker.beep()\n```\n\n***\n\n## Repo Resources\n\n* [Visual Studio Code](https://code.visualstudio.com/)\n* [MicroPython for LEGO Robot Inventor](https://www.lego.com/en-ca/themes/mindstorms/downloads)\n* [LEGO Mindstorms](https://www.lego.com/en-ca/themes/mindstorms)\n* [LEGO Mindstorms App for Mac](https://apps.apple.com/us/app/lego-mindstorms-inventor/id1515448947)\n* [LEGO Mindstorms App for Android](https://play.google.com/store/apps/details?id=com.lego.retail.mindstorms)\n* [LEGO Mindstorms App for Windows](https://www.microsoft.com/store/apps/9N7GN3KC2GK6)\n\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://codeadam.ca/images/code-block.png\" width=\"100\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fspike-motors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fspike-motors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fspike-motors/lists"}