{"id":33145510,"url":"https://github.com/janickr/kaspersmicrobit","last_synced_at":"2025-12-14T16:42:52.708Z","repository":{"id":58391574,"uuid":"456010272","full_name":"janickr/kaspersmicrobit","owner":"janickr","description":"A python package to connect to the Bluetooth LE GATT services of BBC micro:bit devices. Use your micro:bit as a wireless game controller!","archived":false,"fork":false,"pushed_at":"2025-11-11T16:59:57.000Z","size":21145,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-11T18:19:40.262Z","etag":null,"topics":["bbc-microbit","ble","bluetooth","bluetooth-low-energy","microbit","python"],"latest_commit_sha":null,"homepage":"https://kaspersmicrobit.readthedocs.io/en/stable/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janickr.png","metadata":{"files":{"readme":"README-nl.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-05T23:25:54.000Z","updated_at":"2025-11-11T16:57:04.000Z","dependencies_parsed_at":"2022-09-10T09:12:25.961Z","dependency_job_id":"75ac9d62-8979-4982-924e-371526dc6122","html_url":"https://github.com/janickr/kaspersmicrobit","commit_stats":{"total_commits":114,"total_committers":2,"mean_commits":57.0,"dds":0.00877192982456143,"last_synced_commit":"540f332154590de565bc38e27178758aa28854a9"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/janickr/kaspersmicrobit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janickr%2Fkaspersmicrobit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janickr%2Fkaspersmicrobit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janickr%2Fkaspersmicrobit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janickr%2Fkaspersmicrobit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janickr","download_url":"https://codeload.github.com/janickr/kaspersmicrobit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janickr%2Fkaspersmicrobit/sbom","scorecard":{"id":505121,"data":{"date":"2025-08-11","repo":{"name":"github.com/janickr/kaspersmicrobit","commit":"42e619c8fcbb3a10bc100028f074b3d97c9d725b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lint_and_test.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: Mozilla Public License 2.0: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.5.0 not signed: https://api.github.com/repos/janickr/kaspersmicrobit/releases/143538403","Warn: release artifact 0.4.2 not signed: https://api.github.com/repos/janickr/kaspersmicrobit/releases/108968640","Warn: release artifact 0.4.1 not signed: https://api.github.com/repos/janickr/kaspersmicrobit/releases/108449099","Warn: release artifact 0.4.0 not signed: https://api.github.com/repos/janickr/kaspersmicrobit/releases/96941964","Warn: release artifact 0.3.4 not signed: https://api.github.com/repos/janickr/kaspersmicrobit/releases/76052000","Warn: release artifact 0.5.0 does not have provenance: https://api.github.com/repos/janickr/kaspersmicrobit/releases/143538403","Warn: release artifact 0.4.2 does not have provenance: https://api.github.com/repos/janickr/kaspersmicrobit/releases/108968640","Warn: release artifact 0.4.1 does not have provenance: https://api.github.com/repos/janickr/kaspersmicrobit/releases/108449099","Warn: release artifact 0.4.0 does not have provenance: https://api.github.com/repos/janickr/kaspersmicrobit/releases/96941964","Warn: release artifact 0.3.4 does not have provenance: https://api.github.com/repos/janickr/kaspersmicrobit/releases/76052000"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint_and_test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/lint_and_test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint_and_test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/lint_and_test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/janickr/kaspersmicrobit/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/lint_and_test.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/lint_and_test.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/lint_and_test.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/lint_and_test.yml:39","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:21","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   6 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-19T23:06:35.625Z","repository_id":58391574,"created_at":"2025-08-19T23:06:35.625Z","updated_at":"2025-08-19T23:06:35.625Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27731484,"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-12-14T02:00:11.348Z","response_time":56,"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":["bbc-microbit","ble","bluetooth","bluetooth-low-energy","microbit","python"],"created_at":"2025-11-15T13:00:33.624Z","updated_at":"2025-12-14T16:42:52.700Z","avatar_url":"https://github.com/janickr.png","language":"Python","readme":"# Kasper's micro:bit\nHeb je [Programmeren met Python](https://www.visualsteps.nl/programmerenpython/) uitgelezen? Zou het niet geweldig zijn\nom je [BBC micro:bit](https://microbit.org/) als **wireless gamecontroller** te gebruiken voor je zelf gemaakte games? \nDat kan je doen met dit python package! Pair je [micro:bit](https://microbit.org/) met bluetooth aan je computer en \n**gebruik de A en B knoppen of de accelerometer om je spel te besturen**. Like it? Geef ons een ster op github\n\n[![Lint and Test](https://github.com/janickr/kaspersmicrobit/actions/workflows/lint_and_test.yml/badge.svg)](https://github.com/janickr/kaspersmicrobit/actions/workflows/lint_and_test.yml)\n[![Documentation Status](https://readthedocs.org/projects/kaspersmicrobit/badge/?version=stable)](https://kaspersmicrobit.readthedocs.io/nl/stable/?badge=stable) \n[![PyPi](https://img.shields.io/pypi/v/kaspersmicrobit)](https://pypi.org/project/kaspersmicrobit/) \n[![English](https://img.shields.io/badge/translation-English-blue)](https://kaspersmicrobit.readthedocs.io/en/stable/)\n\nKasper's microbit is een python package om een verbinding te kunnen maken met een BBC micro:bit met behulp van de Bluetooth LE GATT services \ndie de micro:bit aanbiedt.\n\n[![Video of games created with kaspersmicrobit](https://kaspersmicrobit.readthedocs.io/en/latest/assets/images/kaspersmicrobit-youtube.gif)](https://www.youtube.com/watch?v=t3JARVPQE9Q)\n  \nBekijk de volledige video [op youtube](https://www.youtube.com/watch?v=t3JARVPQE9Q)\n\n## Hoe te starten\nInstalleer kaspersmicrobit:\n```bash\n$ pip install kaspersmicrobit\n```\nKopieer [dit hex bestand](https://kaspersmicrobit.readthedocs.io/nl/latest/assets/hex/microbit-bluetooth-accel-buttons-led-temp-no-pairing.hex)\nnaar de micro:bit en start je eerste programma:\n```python\nimport time\n\nfrom kaspersmicrobit import KaspersMicrobit\n\n\ndef pressed(button):\n    print(f\"button {button} pressed\")\n\nwith KaspersMicrobit.find_one_microbit() as microbit:\n    microbit.buttons.on_button_a(press=pressed)\n    time.sleep(10)\n```\n\n## Leer meer\nBezoek https://kaspersmicrobit.readthedocs.io/nl/:\n\n - Probeer de [accelerometer](https://kaspersmicrobit.readthedocs.io/nl/stable/accelerometer/), of de [led display](https://kaspersmicrobit.readthedocs.io/nl/stable/led/)\n - [Leer](https://kaspersmicrobit.readthedocs.io/nl/stable/makecode-bluetooth/create-a-makecode-project-without-pairing/) je eigen .hex bestanden te maken\n - [Eenvoudige voorbeelden](https://kaspersmicrobit.readthedocs.io/nl/stable/buttons/), leer hoe je iedere Bluetooth service van de micro:bit kan gebruiken \n - [Volledige Api documentatie](https://kaspersmicrobit.readthedocs.io/nl/stable/reference/kaspersmicrobit/)\n - Combineer KaspersMicrobit [met tkinter](https://kaspersmicrobit.readthedocs.io/nl/stable/tkinter/use_buttons_to_move_rectangle/)\n   of [met pygame](https://kaspersmicrobit.readthedocs.io/nl/stable/pygame/use_buttons_to_move_rectangle/)\n\n\nOf neem een kijkje in de [voorbeelden](https://github.com/janickr/kaspersmicrobit/tree/main/examples).\n\n## Micro:bit versies, operating systems, Bluetooth pairing\n\nIn de onderstaande tabellen zie je welke combinatie van besturingssystemen en micro:bit versies werken.\n\n| micro:bit v2.x | No pairing required | Just works pairing |\n|----------------|---------------------|--------------------|\n| Windows        | :heavy_check_mark:  | :heavy_check_mark: |\n| Linux          | :heavy_check_mark:  | :heavy_check_mark: |\n| MacOS          | :heavy_check_mark:  | :x:                |\n\n| micro:bit v1.x | No pairing required  | Just works pairing |\n|----------------|----------------------|--------------------|\n| Windows        | :heavy_check_mark:   | :x:                |\n| Linux          | :heavy_check_mark:   | :heavy_check_mark: |\n| MacOS          | :heavy_check_mark: * | :x:                |\n\n\\* Magnetometer calibratie van de micro:bit v1 op MacOS faalt met de micro:bit die niet antwoordt of out of memory gaat (error 020 + droevige smiley)\n\n## Troubleshooting\n### Upgrade naar de laatste versie\n```bash\n$  pip install --upgrade kaspersmicrobit  \n```\n### Bluetooth connectie\nSchakel je micro:bit eerst een keer uit en aan.\n\nKijk ook na: indien je de \"with\"-blok niet gebruikt, maar in de plaats daarvan zelf `.connect()` oproept, zorg er dan voor \ndat je in elk geval ook `.disconnect()` oproept wanneer je de connectie niet meer nodig hebt (bijvoorbeeld wanneer je \nprogramma eindigt)\n\n#### No pairing required\nAls het .hex bestand gemaakt werd met de instelling [\"No pairing required\"](https://kaspersmicrobit.readthedocs.io/nl/stable/makecode-bluetooth/create-a-makecode-project-without-pairing/#koppeling-uitschakelen)\ndan mag de micro:bit niet gepaired zijn met je besturingssysteem\n\n#### Just works pairing \nGebruik geen pairing bij een micro:bit v1 en windows, gebruik  [\"No pairing required\"](https://kaspersmicrobit.readthedocs.io/nl/stable/makecode-bluetooth/create-a-makecode-project-without-pairing/#koppeling-uitschakelen)\nin de plaats.  \n\nVoor andere versies: verwijder de micro:bit van de lijst met gepairde Bluetooth toestellen en pair het opnieuw met je computer.\n\nZie ook: [The micro:bit Bluetooth troubleshooting guide](https://support.microbit.org/helpdesk/attachments/19075694226) (.docx word bestand download)\n\n### Wat is de naam van mijn micro:bit?\nZie: [How to find the name of your micro:bit](https://support.microbit.org/support/solutions/articles/19000067679-how-to-find-the-name-of-your-micro-bit)\n\n\n### De micro:bit toont een droevige smiley en fout 020\nDit betekent dat de micro:bit een tekort aan geheugen heeft. Je hebt waarschijnlijk te veel Bluetooth services geactiveerd\nin MakeCode. Of misschien is je MakeCode programma te groot. Omdat de micro:bit v1 minder geheugen heeft dan de v2, is \nde kans groter dat deze fout zich voordoet bij v1 micro:bits.  \nZie ook: [the micro:bit error codes](https://makecode.microbit.org/device/error-codes)\n\n### tkinter \"main thread is not in main loop\"\nWanneer je kaspersmicrobit combineert met tkinter (de window module die gebruikt wordt in [Programmeren met Python](https://www.visualsteps.nl/programmerenpython/))\nkan je de TK fout \"main thread is not in main loop\" tegenkomen. Dit is waarschijnlijk omdat je TK code oproept vanuit\neen callback functie die je meegegeven hebt om omgeroepen te worden wanneer een druk op de knop gebeurt of wanneer\ner nieuwe accelerometer gegevens zijn (of iets anders). Deze callback wordt uitgevoerd op een andere thread en tkinter\nwil dit niet. Hier zijn minstens 2 oplossingen voor:  \n\n  - roep geen tkinter code op in een callback\n  - omsluit de callback met `kaspersmicrobit.tkinter.do_in_tkinter(tk, jouw_callback)` dit zorgt ervoor dat je callback\n    uitgevoerd zal worden op de tk thread, dit vermijdt het probleem\n","funding_links":[],"categories":["🐍 Python"],"sub_categories":["🐍 Python Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanickr%2Fkaspersmicrobit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanickr%2Fkaspersmicrobit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanickr%2Fkaspersmicrobit/lists"}