{"id":16977389,"url":"https://github.com/mryslab/kitronik_motor_board","last_synced_at":"2026-04-13T18:31:16.062Z","repository":{"id":72328489,"uuid":"117913442","full_name":"MrYsLab/kitronik_motor_board","owner":"MrYsLab","description":"A MicroPython class to control the kitronik motor driver for the micro:bit","archived":false,"fork":false,"pushed_at":"2018-01-21T16:36:06.000Z","size":928,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-20T07:02:57.443Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrYsLab.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}},"created_at":"2018-01-18T01:14:19.000Z","updated_at":"2021-10-30T06:17:02.000Z","dependencies_parsed_at":"2023-07-24T05:01:29.663Z","dependency_job_id":null,"html_url":"https://github.com/MrYsLab/kitronik_motor_board","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MrYsLab/kitronik_motor_board","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrYsLab%2Fkitronik_motor_board","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrYsLab%2Fkitronik_motor_board/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrYsLab%2Fkitronik_motor_board/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrYsLab%2Fkitronik_motor_board/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrYsLab","download_url":"https://codeload.github.com/MrYsLab/kitronik_motor_board/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrYsLab%2Fkitronik_motor_board/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31766290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: 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":[],"created_at":"2024-10-14T01:28:50.884Z","updated_at":"2026-04-13T18:31:16.047Z","avatar_url":"https://github.com/MrYsLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## A micro:bit MicroPython Class To Control The\n\n## [Kitronik Motor Driver Board](https://www.kitronik.co.uk/5620-motor-driver-board-for-the-bbc-microbit-v2.html)\n![logo](https://raw.github.com/MrYsLab/kitronic_motor_board/master/images/motor_board.png)\n\n\n``` \n# k_motor.py API\n\nclass KMotor:\n   \n    # Motor Directions\n    FORWARD = 0\n    REVERSE = 1\n\n    # Motor Selectors\n    MOTOR_1 = 0\n    MOTOR_2 = 1\n    \n    def __init__(self):\n        \"\"\"\n        Turn off both motors and clear the display\n        \"\"\"\n        \n    def motor_on(self, motor, direction, speed=100):\n        \"\"\"\n        Turn motor with the given direction and speed.\n        If speed is out of range, the NO image will\n        be displayed and no motor will be turned on.\n        :param motor: KMotor.MOTOR1 or KMotor.Motor2\n        :param direction: KMotor.FORWARD or KMOTOR.REVERSE\n        :param speed: 0 - 100\n        \n    def motor_off(self, motor):\n        \"\"\"\n        Place motor in coast mode\n        :param motor: KMotor.MOTOR1 or KMotor.Motor2\n        \n    def motor_brake(self, motor):\n        \"\"\"\n        Brake the selected motor.\n        :param motor:\n\n```\n\n## Using the class\n[This article](https://microbit-playground.co.uk/howto/add-python-module-microbit-micropython) explains how to add\na third party library, like k_motor.py, to the micro:bit persistent file system.\n\nAlthough more \"pythonic\" than simply adding the KMotor class to the top of of the application, as was done for the [included\nexample](https://github.com/MrYsLab/kitronic_motor_board/blob/master/examples/run_motors.py), this method has some drawbacks. If you\nmake any changes to the application, the entire procedure of loading of the application and library has to be repeated.\n\nTherefore, adding the k_motor to the top of the application during development is more convenient. Once the application is\ndebugged and complete, using the persistent file system method is totally appropriate.\n\nTo help save value memory space in the micro:bit, a minimized file, \n[k_motor_minimized.py](https://github.com/MrYsLab/kitronic_motor_board/blob/master/k_motor_minimized.py)\n has been provided for your convenience. It removes all comments and \nunnecessary while space from k_motor.py.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmryslab%2Fkitronik_motor_board","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmryslab%2Fkitronik_motor_board","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmryslab%2Fkitronik_motor_board/lists"}