Skip to main content

Python library for driving Pimoroni Plasma and other LED devices

Project description

Plasma: LED Sequencing

Plasma is an LED/Light sequencing suite written to harmonise a variety of LED strand/board types and interfaces into a standard API for write-once-run-anyway lighting code.

Plasma also includes plasmad, a system daemon for sequencing light strips using PNG images to provide animation frames.

Build Status Coverage Status PyPi Package Python Versions

Compatible Products

Plasma was originally written to provide an easy way to sequence lights and swap out patterns for the Pimoroni Plasma kit.

Installing

Full install (recommended):

We've created an easy installation script that will install all pre-requisites and get your Plasma Arcade Button Lights up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop, as illustrated below:

Finding the terminal

In the new terminal window type the command exactly as it appears below (check for typos) and follow the on-screen instructions:

curl https://get.pimoroni.com/plasma | bash

If you choose to download examples you'll find them in /home/pi/Pimoroni/plasma/.

Manual install:

sudo pip3 install plasmalights

Using Plasma Daemon

To install the Plasma daemon you should clone this repository, navigate to the "daemon" directory and run the installer:

git clone https://github.com/pimoroni/plasma
cd plasma/daemon
sudo ./install

Note: If you're using Picade Player X you should edit daemon/etc/systemd/system/plasma.service and change the output device option from -o GPIO:15:14 to -o SERIAL:/dev/ttyACM0. If you're using Unicorn HAT or pHAT you should use -o WS281X:WS2812:18:0.

If you're using GPIO on a Picade HAT you can adjust the pins accordingly using -o GPIO:<data>:<clock> where data and clock are valid BCM pins. If you're using the old Plasma/Hack header you may need to swap from -o GPIO:15:14 to -o GPIO:14:15 depending on how your connections are wired.


The Plasma daemon installer installs two programs onto your Raspberry Pi. plasma itself and a tool called plasmactl you can use to install and switch lighting effects. Plasma runs as a service on your system.

plasmactl commands:

  • plasmactl 255 0 0 - Set Plasma lights to R, G, B colour. Red in this case.
  • plasmactl <pattern> - Set Plasma lights to pattern image
  • plasmactl fps <fps> - Change plasma effect framerate (default is 30, lower FPS = less CPU)
  • plasmactl --list - List all available patterns
  • sudo plasmactl --install <pattern> - Install a new pattern, where <pattern> is the filename of a 24bit PNG image file

Development:

If you want to contribute, or like living on the edge of your seat by having the latest code, you should clone this repository, cd to the library directory, and run:

sudo python3 setup.py install

Documentation & Support

Changelog

2.0.1

  • New auto() can accept a config file path directly (for plasma daemon)
  • New Matrix and Core now accept list and dict type sequences in set_sequence
  • New Matrix config supports an "enabled" option for easy config switching
  • Bugfix Matrix catches KeyError when trying to del non-required options

2.0.0

  • Port to Python >=3.7, drop Python 2.7 support
  • Significant refactoring and restructuring
  • Config file support for configuring LED types/relationships
  • WS382X support
  • Chip-Select support for APA102
  • PlasmaMatrix to combine multiple output devices

1.0.0

  • API refactor, use plasma.legacy for old API
  • USB support for Picade Player X

0.0.1

  • Initial Release

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

plasmalights-2.0.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

plasmalights-2.0.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file plasmalights-2.0.1.tar.gz.

File metadata

  • Download URL: plasmalights-2.0.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.3

File hashes

Hashes for plasmalights-2.0.1.tar.gz
Algorithm Hash digest
SHA256 84bab83c1aafed4a226c6da2c8b4040f3456ea948a717ddf63fcde92fb968476
MD5 ac10fef8104b161246cc167fa222a05b
BLAKE2b-256 fe2d07aae2cfc1cdb6de3bfbcd62d8890d51f6eb97269ff75e187c6e043e6dac

See more details on using hashes here.

File details

Details for the file plasmalights-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: plasmalights-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.3

File hashes

Hashes for plasmalights-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85d4a625a759c728791d73fbe1942773f8e544659181f8e6d4ee0e58dcdef684
MD5 d17cc01519d110c7c4d611435ea6dab7
BLAKE2b-256 e39ee8cb4e45e99692baa8e3bbc9cc7ffff4b16e2007bbe94d2c6451e6f6f9d6

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