Skip to main content

PyUSB-based Blink(1) control library

Project description

About this library

This is a rewrite of ThingM’s original Python library. It includes the following modifications:

  • 100% test coverage on all library components

  • Python 3.x compatible

  • Automatic installation via Python Package Index.

  • Higher level control over the blink(1).

  • Single implementation with pyusb, intended to be installed with admin access or virtualenv.

Installation

Use the pip utility to fetch the latest release of this package and any additional components required in a single step:

pip install blink1

Developer installation

Having checked out the blink(1) library, cd to python/pypi and run the setup script:

python setup.py develop

Use

The simplest way to use this library is via a context manager.

import time from blink1.blink1 import blink1

with blink1() as b1:

b1.fade_to_color(100, ‘navy’) time.sleep(10)

When the blink1() block exits the light is automatically switched off. It is also possible to access the exact same set of functions without the context manager:

from blink1.blink1 import Blink1

import time

b1 = Blink1() b1.fade_to_rgb(1000, 64, 64, 64) time.sleep(3) b1.fade_to_rgb(1000, 255, 255, 255)

Unlike the context manager, this demo will leave the blink(1) at the end of execution.

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

blink1-0.0.9.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

blink1-0.0.9-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file blink1-0.0.9.tar.gz.

File metadata

  • Download URL: blink1-0.0.9.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for blink1-0.0.9.tar.gz
Algorithm Hash digest
SHA256 fbdc232062edc17f5a2538a02cc27f47f53a25837b61f6970b2a774da471d378
MD5 8be27c39fdd97b6556fcd384efa35c2b
BLAKE2b-256 91b2d805a8a089803d749bb745e6b3864bf10104e848cb08f64ccaa244f15eb8

See more details on using hashes here.

File details

Details for the file blink1-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for blink1-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1ad77d02679a51d325adab18ddf5b78a1a1a53ecb6196ede4f344a4d527e5942
MD5 6a92e489673b4198ab0859fb3e51bd9e
BLAKE2b-256 2295354263d536e69969eda9a896d01a2679a7def3f1b64ba61fd9504946b591

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