Skip to main content

A driver to connect to and control a Brilliant Labs Monocle peripheral

Reason this release was yanked:

Bad README file

Project description

Monocle Driver

monocle-driver is a simple Python library that uses Bleak to connect to and control a Brilliant Labs Monocle display device.


pip install monocle-driver

Usage example

import asyncio
from monocle-driver import Monocle

def callback(channel, text_in):
  Callback to handle incoming text from the Monocle.

# Simple MicroPython command that prints battery level for five seconds
# and then blanks the screen
import display
import device
import time

def show_battery(count):
  batLvl = str(device.battery_level())
  display.text("bat: {} {}".format(batLvl, count), 5, 5, 0xffffff)

count = 0
while (count < 5):
  count += 1




async def execute():
    mono = Monocle(callback)
    async with mono:
        await mono.send(COMMAND)


monocle-driver attaches to a Monocle via the UART characteristics exposed over BLE in Monocle's default firmware, as specified in the Monocle documentation. Once connection is established, commands can be sent directly to the Monocle as MicroPython. The driver avoids MTU overflow and does some convenience / correction massaging (sending Ctrl-C to stop any running command and wrapping the incoming command in Ctrl-A | Ctrl-D to avoid interference from the REPL's echo and auto-formatting convenience behaviors).

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

brilliant_monocle_driver-0.1.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

brilliant_monocle_driver-0.1.0-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

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