Skip to main content

A library and CLI tool to control Busy Tag devices.

Project description

busytag_tool

PyPI version License

Python library and CLI to interact with Busy Tag devices using the USB CDC interface.

Installation

$ pip install busytag

CLI usage

If you have multiple devices connected to your machine, you should specify the port with the --device flag. If only one device is connected, the tool will automatically use it.

$ busytag-tool

	USAGE: busytag-tool [flags] <command> [<args>]

Available commands:
  help: Prints this message
  list_devices: Lists available devices
  info: Displays device information
  list_pictures: Lists pictures in device
  list_files: Lists files in device
  get_picture: Gets the filename of the picture being shown
  set_picture <filename>: Sets the picture shown in the device
  put <filename>: Uploads <filename>
  get <filename>: Copies <filename> from the device to the working directory
  rm <filename>: Deletes <filename>
  set_led_solid_color <6 hex RGB colour>: Sets the LEDs colour
  apply_led_preset <preset name>: Sets the LEDs colour according to a preset
  get_brightness: Gets current display brightness
  set_brightness <brightness>: Sets current display brightness (int between 1 and 100, inclusive

$ busytag-tool set_picture coding.png

Config

A config file is created at ~/.busytag.toml. You can add "led preset" entries there, which can then be used with the apply_led_preset to change the device's LED colours. For example, here are two entries, one that applies the same colour to all LEDs, and another that alternates colours:

[[led_presets.red]]
pins = 127
color = 'FF0000'

[[led_presets.rb]]
pins = 85
color = 'FF0000'

[[led_presets.rb]]
pins = 42
color = '0000FF'

The BusyTag device has seven LEDs (with the first one, 0, at the bottom left of the device), identified in this tool by powers of two. The pins entry in the config is the sum of which pins we want to apply the colour (so 127 applies to all, while 85 applies to pins 0, 2, 4 and 6).

API usage

from busytag import Device, LedConfig, LedPin

bt = Device('/dev/fooBar')
bt.set_active_picture('coding.gif')
bt.set_led_solid_color(LedConfig(LedPin.ALL, 'FF0000'))

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

busytag-0.1.5.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

busytag-0.1.5-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file busytag-0.1.5.tar.gz.

File metadata

  • Download URL: busytag-0.1.5.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for busytag-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5ff92883236881803768efb29fbd18960011c578aea84d5737dbe6f9249946d1
MD5 06c3556495d8a8e90cf62b3f6cccc648
BLAKE2b-256 56c9cbecb3c7af4d04b866bbf1aadfc5205b6a294e599df34590ff599738a92a

See more details on using hashes here.

File details

Details for the file busytag-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: busytag-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for busytag-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0108b3b62c042bbe040290affaf20eba5c472756d29f0f1404d19094295176fb
MD5 8e073af14518623f29f1736f746d9128
BLAKE2b-256 75d059a0c436c974883f9b747f4b1d747163d77851f4efecc2294d479658a926

See more details on using hashes here.

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