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.8.tar.gz
(23.1 kB
view hashes)
Built Distribution
Close
Hashes for kaspersmicrobit-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a43d2ccb941316374b9114824e4e00123bb52e9fbf02af755234630c37322f76 |
|
MD5 | d97832df2a153b7ca86a7a96947dc039 |
|
BLAKE2b-256 | a0c9ac965b49c9d5634df3674946fabec2493cc9bd23a8a2e7ce2d058d7b24bf |