Skip to main content

No project description provided

Project description

OVOS Mark1 Client

small library to interact with a Mycroft Mark1 faceplate via the messagebus

gives you full control of the faceplate and eyes pixel by pixel

Usage

drawing in python

from ovos_mark1.faceplate import BlackScreen

class MusicIcon(BlackScreen):
    str_grid = """
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXX     XXXXXXXXXXXXX
XXXXXXXXXXXXXX     XXXXXXXXXXXXX
XXXXXXXXXXXXXX XXX XXXXXXXXXXXXX
XXXXXXXXXXXXXX XXX XXXXXXXXXXXXX
XXXXXXXXXXXXX  XX  XXXXXXXXXXXXX
XXXXXXXXXXXX   X   XXXXXXXXXXXXX
XXXXXXXXXXXXX XXX XXXXXXXXXXXXXX
"""

icon = MusicIcon()
icon.print()  # show in terminal
icon.display()  # show in mark1

Animate the eyes

from ovos_mark1.eyes import Eyes
from ovos_utils.messagebus import get_mycroft_bus

bus = get_mycroft_bus("0.0.0.0")

eyes = Eyes(bus)
eyes.hue_spin()

Animation helpers

# it's snowing !
class FallingDots(FacePlateAnimation):
    def __init__(self, n=10, bus=None):
        super().__init__(bus=bus)
        self._create = True
        assert 0 < n < 32
        self.n = n

    @property
    def n_dots(self):
        n = 0
        for y in range(self.height):
            for x in range(self.width):
                if self.grid[y][x]:
                    n += 1
        return n

    def animate(self):
        self.move_down()
        if self._create:
            if random.choice([True, False]):
                self._create = False
                x = random.randint(0, self.width - 1)
                self.grid[0][x] = 1
        if self.n_dots < self.n:
            self._create = True

Pre made animations

from ovos_mark1.faceplate.animations import ParticleBox
from ovos_utils.messagebus import get_mycroft_bus
from time import sleep

bus = get_mycroft_bus("0.0.0.0")

for faceplate in ParticleBox(bus=bus):
    faceplate.display(invert=False)
    sleep(0.5)


from ovos_mark1.faceplate.cellular_automaton import Rule110

a = Rule110(bus=bus)

for grid in a:
    grid.print()  # animate in terminal
    grid.display(invert=False)
    sleep(0.5)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ovos_mark1_utils-0.0.0a1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file ovos_mark1_utils-0.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_mark1_utils-0.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe0fe16114649fa22c596a7ea7061b548ccd06a78b91d89ab43afd58ae6ba0c1
MD5 b6be7446d2dcda2e3bdd38e5e4ca90fe
BLAKE2b-256 0a93383fabb1bd214d1fd9654d831219ecd3b019f1d40238c794017e2731431e

See more details on using hashes here.

Supported by

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