Skip to main content

Ozobot EVO library

Project description

ozobot-evo

Interface for controlling Ozobot Evo. 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.evo import EvoHandle, Evo
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 EvoHandle(id="ABCDE*") as evo:
    await evo.move(100, 50)
    await evo.rotate(180, 90)

    velo_task = asyncio.create_task(evo.set_velocity(50, 0))
    await asyncio.sleep(2)
    velo_task.cancel()

    await evo.set_led(LEDMask.FRONT_CENTER | LEDMask.FRONT_LEFT | LEDMask.FRONT_RIGHT, NamedColor.BLUE)
    await evo.set_led(LEDMask.FRONT_LEFT_CENTER | LEDMask.FRONT_RIGHT_CENTER, NamedColor.RED)

    await evo.play_sound("happy")
    await evo.play_tone("A", 4, 1, 1)

    await evo.follow_line(Direction.STRAIGHT)
    intersection = await evo.data.intersection.read()
    print(f"At intersection: {intersection.value}")

    async with evo.data.intersection.watch() as intersections, evo.data.color_code.watch() as codes:
      t1 = asyncio.create_task(_monitor(intersections))
      t2 = asyncio.create_task(_monitor(codes))

      await evo.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

ozobot_evo-0.2.0.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

ozobot_evo-0.2.0-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file ozobot_evo-0.2.0.tar.gz.

File metadata

  • Download URL: ozobot_evo-0.2.0.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ozobot_evo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1c8f01d45d9d3144a4389ffa210334e06d1f2379b23ea472176362ade3d63fe9
MD5 c18d075f09e6961123e73d290a46c8c5
BLAKE2b-256 9fba9208e3a75faa91f4b0756989cb65ce51561b662238fa5cc1009ba84bca1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ozobot_evo-0.2.0.tar.gz:

Publisher: publish.yml on ozobot/python-libraries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ozobot_evo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ozobot_evo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ozobot_evo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59a1e7d2aeac7b5e29bd423ce7bd58a51d1765f32958abb25ea864c1fe85d6d7
MD5 96aa21ebf1aad2c9f495b0686c62d207
BLAKE2b-256 2fb0c6cabdeda7bddc197b996b2be7d03000199df67614bae148e8efe6b90d16

See more details on using hashes here.

Provenance

The following attestation bundles were made for ozobot_evo-0.2.0-py3-none-any.whl:

Publisher: publish.yml on ozobot/python-libraries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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