Ozobot ARI library
Project description
ozobot-ari
Interface for controlling Ozobot Ari. See the monorepo for more details.
Work in progress, only a web runtime driver for Ozobot Editor available
Usage
import asyncio
import random
from ozobot.ari import AriHandle, Ari
from ozobot.linefollower import NamedColor, LEDMask, Direction
async def monitor(it):
async for data in it:
print(f"Sample taken: {data.value}")
async def main():
async with AriHandle(id="ABCDE*") as ari:
await ari.move(100, 50)
await ari.rotate(180, 90)
velo_task = asyncio.create_task(ari.set_velocity(50, 0))
await asyncio.sleep(2)
velo_task.cancel()
await ari.set_led(LEDMask.FRONT_CENTER | LEDMask.FRONT_LEFT | LEDMask.FRONT_RIGHT, NamedColor.BLUE)
await ari.set_led(LEDMask.FRONT_LEFT_CENTER | LEDMask.FRONT_RIGHT_CENTER, NamedColor.RED)
await ari.play_sound("happy")
await ari.play_note("A", 4, 1)
await ari.follow_line(Direction.STRAIGHT)
intersection = await ari.data.intersection.read()
print(f"At intersection: {intersection.value}")
async with ari.data.intersection.watch() as intersections, ari.data.color_code.watch() as codes:
t1 = asyncio.create_task(_monitor(intersections))
t2 = asyncio.create_task(_monitor(codes))
await ari.follow_line(random.choice(list(intersection.value)))
t1.cancel()
t2.cancel()
asyncio.run(main())
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
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 ozobot_ari-0.3.2.tar.gz.
File metadata
- Download URL: ozobot_ari-0.3.2.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2602f2ea1d4d71fa9ba327eae5b628e254f3cfb2305e8b45098d7143e03edec4
|
|
| MD5 |
a7a2badfecff95b3e0970196025120c2
|
|
| BLAKE2b-256 |
96b1c10b7e3ee889edf703774d172d0def4f0e6f8be3d823c20e5f09055dc337
|
Provenance
The following attestation bundles were made for ozobot_ari-0.3.2.tar.gz:
Publisher:
publish.yml on ozobot/python-libraries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ozobot_ari-0.3.2.tar.gz -
Subject digest:
2602f2ea1d4d71fa9ba327eae5b628e254f3cfb2305e8b45098d7143e03edec4 - Sigstore transparency entry: 1400831612
- Sigstore integration time:
-
Permalink:
ozobot/python-libraries@b164fef72fe306687ea2677b7fb3a10f848e80c6 -
Branch / Tag:
refs/tags/ozobot-ari-v0.3.2 - Owner: https://github.com/ozobot
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b164fef72fe306687ea2677b7fb3a10f848e80c6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ozobot_ari-0.3.2-py3-none-any.whl.
File metadata
- Download URL: ozobot_ari-0.3.2-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d1642aa33cfe5fdf047f2f0010bc4fd7320b8cd585941dc0bf0e82b7d0b19a4
|
|
| MD5 |
125559c610127de8d3bbb1603be99301
|
|
| BLAKE2b-256 |
30edcd82b814f9aab1fb51be1ef745ff232ccbfbd0b990e87563c0db23f2e826
|
Provenance
The following attestation bundles were made for ozobot_ari-0.3.2-py3-none-any.whl:
Publisher:
publish.yml on ozobot/python-libraries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ozobot_ari-0.3.2-py3-none-any.whl -
Subject digest:
5d1642aa33cfe5fdf047f2f0010bc4fd7320b8cd585941dc0bf0e82b7d0b19a4 - Sigstore transparency entry: 1400831718
- Sigstore integration time:
-
Permalink:
ozobot/python-libraries@b164fef72fe306687ea2677b7fb3a10f848e80c6 -
Branch / Tag:
refs/tags/ozobot-ari-v0.3.2 - Owner: https://github.com/ozobot
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b164fef72fe306687ea2677b7fb3a10f848e80c6 -
Trigger Event:
push
-
Statement type: