A python package to connect to the Bluetooth LE GATT services of paired bbc micro:bit devices
Project description
Kasper's microbit
A python package to make a connection to a bbc microbit by means of the Bluetooth LE GATT services exposed by the microbit
Installation
$ pip install kaspersmicrobit
Example
import time
from kaspersmicrobit import KaspersMicrobit
CHANGE_THIS_TO_YOUR_MICROBIT_BLUETOOTH_ADDRESS = 'E3:7E:99:0D:C1:BA'
def pressed(button):
print(f"button {button} pressed")
with KaspersMicrobit(CHANGE_THIS_TO_YOUR_MICROBIT_BLUETOOTH_ADDRESS) as microbit:
microbit.buttons.on_button_a(press=pressed)
time.sleep(10)
More examples can be found in the examples directory.
Api documentation
https://kaspersmicrobit.readthedocs.io
Troubleshooting
Problems related to connecting to the microbit over bluetooth are often solved by pairing your computer again to your microbit
See also: https://support.microbit.org/helpdesk/attachments/19075694226
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kaspersmicrobit-0.0.8.tar.gz.
File metadata
- Download URL: kaspersmicrobit-0.0.8.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
028eefd3a6628bb9cbcef348adc48455d840d680a5fef3885a93bbd97ec84cda
|
|
| MD5 |
9e0f75b2613eda7d0dfba288a8084a22
|
|
| BLAKE2b-256 |
79a85ffcd25fe4191729a759932c6d872a0ca49bdf590b02de9e400094885590
|
File details
Details for the file kaspersmicrobit-0.0.8-py3-none-any.whl.
File metadata
- Download URL: kaspersmicrobit-0.0.8-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a43d2ccb941316374b9114824e4e00123bb52e9fbf02af755234630c37322f76
|
|
| MD5 |
d97832df2a153b7ca86a7a96947dc039
|
|
| BLAKE2b-256 |
a0c9ac965b49c9d5634df3674946fabec2493cc9bd23a8a2e7ce2d058d7b24bf
|