Code Monkey home page Code Monkey logo

rpi-ws281x-matrix-python's Introduction

WS281X NeoPixel-ish Matrix Rendering Library

This library is intended to make the neopixel ish LED matrix to work with raspberry pi and Python. It is based on this rpi-ws281x python implementation. This makes it setting up your LED panel faster and removes a lot of hiccups. The original library does not work with panel, it is meant to control the strip.

Features offered

  • Direct resizing and rendering of images (png/jpeg).
  • Direct resizing and rendering of animations (gif)
  • Frames are represented as RGB Tuples so building your own frame is very simple.
  • Excellent brightness control.
  • Support for multi panel configurations.
  • Non-blocking threads, the operations are async and will not block you.

Setup

You'll need to install pillow and rpi-ws281x packages (and their dependencies from pip)

# pip install pillow rpi-ws281x

Demo

# python demo.py

The order is red -> green -> blue -> image -> animation. If this is not the order you see, your strip config is different than the mine.

Adding to your project

Add it as a submodule.

$ git submodule add https://github.com/whizzzkid/rpi-ws281x-matrix-python matrix

In your project

from matrix.ws281xMatrix import WS281xMatrix

screen = WS281xMatrix()

API

Once you have:

screen = WS281xMatrix()

You can simply ask it to render an image like so:

screen.render_image('path_to_image')

Why is this needed?

When I wrote this, I was frustrated to make this 16x16 panel work with RPi. The Adafruit Neopixel library claims that their panels cannot work with RPi because of their strict timing requirements. However that is not the case. The rpi-281x library is a proof that it works, however it does not allow you to dump images/animations directly on the screen. This library aims to solve just that.

License

MIT

rpi-ws281x-matrix-python's People

Contributors

whizzzkid avatar renots1982 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.