{"id":14437124,"url":"https://github.com/fizban99/microbit_us100","last_synced_at":"2025-08-26T20:30:38.235Z","repository":{"id":81708956,"uuid":"84999579","full_name":"fizban99/microbit_us100","owner":"fizban99","description":"Micro:bit library for the ultrasonic sensor us-100 in serial mode","archived":false,"fork":false,"pushed_at":"2021-07-24T16:32:03.000Z","size":4,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-31T08:01:47.028Z","etag":null,"topics":["microbit","micropython","us-100"],"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/fizban99.png","metadata":{"files":{"readme":"README.rst","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":"2017-03-14T21:36:41.000Z","updated_at":"2022-07-10T14:07:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"25a7205d-3bad-4379-945d-4f92bd05794a","html_url":"https://github.com/fizban99/microbit_us100","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizban99%2Fmicrobit_us100","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizban99%2Fmicrobit_us100/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizban99%2Fmicrobit_us100/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizban99%2Fmicrobit_us100/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fizban99","download_url":"https://codeload.github.com/fizban99/microbit_us100/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231071759,"owners_count":18323680,"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":["microbit","micropython","us-100"],"created_at":"2024-08-31T08:00:23.688Z","updated_at":"2024-12-24T08:30:39.120Z","avatar_url":"https://github.com/fizban99.png","language":"Python","funding_links":[],"categories":["编程","🐍 Python"],"sub_categories":["Python","🐍 MicroPython Libraries"],"readme":"Basic micropython library to read the distance from an ultrasonic sensor US-100 in serial mode\n##############################################################################################\n\nThis library allows the micro:bit to read the distance from an ultrasonic sensor US-100 (Y401)).\n\nIt uses the serial port to communicate with the device and to retrieve both the distance and temperature. By default it assumes pin15 connected to trigger/tx and pin14 connected to echo/rx\n\n.. contents::\n\n.. section-numbering::\n\n\nMain features\n=============\n\n* Get the distance in mm from the sonar to an object.\n* Get the temperture measured by the sensor.\n* Sample program.\n\n\nLibrary usage\n=============\n\n\ndistance_mm()\n+++++++++++++++++++++++\n\n\nGet the distance in mm.\n\n\n.. code-block:: python\n\n   from us100 import US100\n   from microbit import sleep\n\n\n   sonar=US100()\n   while True:\n       print('%.1f' % (sonar.distance_mm()/10))\n       sleep(1000)\n\ntemperature()\n+++++++++++++++++++++++\n\n\nGet the temperature from the sonar\n\n\n.. code-block:: python\n\n   from us100 import US100\n   from microbit import sleep\n\n\n   sonar=US100()\n   while True:\n       print('%i' % sonar.temperature)\n       sleep(1000)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffizban99%2Fmicrobit_us100","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffizban99%2Fmicrobit_us100","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffizban99%2Fmicrobit_us100/lists"}