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
kaspersmicrobit-0.0.9.tar.gz
(23.4 kB
view hashes)
Built Distribution
Close
Hashes for kaspersmicrobit-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a979cc290cdf57d1b845801bfe8783a398c99f52ba128a43b2a80b908733e931 |
|
MD5 | c087b998a239ae28e73cf23dcfff6d64 |
|
BLAKE2b-256 | 8ce64e81e67e3a58d45b806306b8f0a0e385706257fb8b05bd667dac29cd040a |