Skip to main content

Rewritten Python Library for Birdbrain Technologies Hummingbird Bit and Finch 2.

Project description

docs

Documentation Status

package

PyPI Package latest release PyPI Wheel Supported versions

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 robot-birdbrain

You can also install the in-development version with:

pip install https://github.com/fmorton/robot-birdbrain/archive/main.zip

Hummingbird Example

from robot.hummingbird 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 robot.finch 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 (requires the robot-tasks package)

from robot.hummingbird import Hummingbird
from robot.tasks 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robot_birdbrain-0.14.2.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robot_birdbrain-0.14.2-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file robot_birdbrain-0.14.2.tar.gz.

File metadata

  • Download URL: robot_birdbrain-0.14.2.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for robot_birdbrain-0.14.2.tar.gz
Algorithm Hash digest
SHA256 0fce76817ae81b26fd8c129b7d1d88d10069907c0c8a7bbf2b65080c9fb3f701
MD5 ab287d5451ceeb6bef88981889335683
BLAKE2b-256 0529eb7e833ba1d241297c150e8a55faa15f7a242b8a939bb8bbf55501c594c9

See more details on using hashes here.

File details

Details for the file robot_birdbrain-0.14.2-py3-none-any.whl.

File metadata

File hashes

Hashes for robot_birdbrain-0.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 afe1fe31f6d955daf90b0cc49b08e8842661b20edc6ebce9d061ea2d6cb34a18
MD5 ae23b64cb40d416d593c40e8a4dfad25
BLAKE2b-256 746b32732a5c7127be5edcea2dc2ea700c587dbc1e3953b2c4d7c1bcb00af7dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page