Rewritten Python Library for Birdbrain Technologies Hummingbird Bit and Finch 2.
Project description
docs |
|
|---|---|
package |
Rewritten Python Library for Birdbrain Technologies Hummingbird Bit and Finch 2
Rewrite inspired by https://github.com/BirdBrainTechnologies/BirdBrain-Python-Library
Free software: GNU Lesser General Public License v3 (LGPLv3)
Installation
pip install birdbrain-python-library-2
You can also install the in-development version with:
pip install https://github.com/fmorton/BirdBrain-Python-Library-2/archive/main.zip
Hummingbird Example
from birdbrain import Hummingbird
from time import sleep
hummingbird = Hummingbird('A')
for i in range(0, 10):
hummingbird.led(1, 100)
sleep(0.1)
hummingbird.led(1, 0)
sleep(0.1)
hummingbird.stop_all()
Finch Example
from birdbrain import Finch
from time import sleep
finch = Finch('A')
for i in range(0, 10):
finch.beak(100, 100, 100)
sleep(0.1)
finch.beak(0, 0, 0)
sleep(0.1)
finch.stop_all()
Tasks Example
from birdbrain import Hummingbird
from birdbrain import Tasks
async def task_1(bird):
while True:
print("task_1 running")
await Tasks.yield_task(1.0)
async def task_2(bird):
while True:
print("task_2 running")
await Tasks.yield_task(0.5)
bird = Hummingbird("A")
tasks = Tasks()
tasks.create_task(task_1(bird))
tasks.create_task(task_2(bird))
tasks.run()
Original Documentation
The original documentation from Birdbrain Technolgies can be found at:
Finch: https://learn.birdbraintechnologies.com/finch/python/library/
Hummingbird: https://learn.birdbraintechnologies.com/hummingbirdbit/python/library/
Testing
To run all the tests run (hummingbird (with micro:bit v2) on ‘A’ and finch on ‘B’):
pytest
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 birdbrain_python_library_2-0.10.4.tar.gz.
File metadata
- Download URL: birdbrain_python_library_2-0.10.4.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc2a72952ca73d408a114516939f992c835f7d2fb27f92b2dc872a4c50652686
|
|
| MD5 |
839e83d7d3a6b348a5245ca1b7022a7f
|
|
| BLAKE2b-256 |
45c645a3fca7c6f870b9f3427e81467716181be4162c514c6ec1929a99c6cb58
|
File details
Details for the file birdbrain_python_library_2-0.10.4-py3-none-any.whl.
File metadata
- Download URL: birdbrain_python_library_2-0.10.4-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c7cc6c9ac5d5c29b91f441238a1e3e2453700370bafeafc53611c059f03a46
|
|
| MD5 |
e4ebb3fd55a264ef0e7419a0611dcdb4
|
|
| BLAKE2b-256 |
b57fcef9de47c41b0f401d559b80bce01bf14cfcb43ded62ca9222b9680f5446
|