Giter Club home page Giter Club logo

rainbow-hat's Introduction

Rainbow-HAT

32/64 LED HAT for Raspberry Pi

Rainbow HAT/pHAT

Available from ALLO.com:

Important Notice

Because Rainbow HAT uses the PWM hardware, which is also how your Raspberry Pi generates analog audio, you may see random colour patterns and flickering.

If this happens, you should add the following to your /boot/config.txt:

hdmi_force_hotplug=1

Sound will work fine using speakers on, for example, an HDMI TV, but you will not be able to use your Pi's 3.5mm audio jack in conjunction with Rainbow HAT.

rainbowhat Python Library & Examples

Here you'll find everything you need to start lighting up your Rainbow HAT or pHAT using python.

Python users should probably ignore most of this repository and just:

sudo apt-get install python-pip python-dev

Install from Github clone

git clone https://github.com/allocom/rainbow-hat
cd rainbow-hat/
sudo apt-get install python-dev python-setuptools
cd library/RainbowHat
sudo python setup.py install
cd ../library/rpi-ws281x
sudo python setup.py install
cd ../..

Then proceed to examples.

Notes:

-rainbow-hat tested with Volumio & max2play images. -rainboa-hat compatible with unicorn-hat python library and examples.


rainbow-hat's People

Contributors

alloboss2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

zoerab mryzl

rainbow-hat's Issues

Mini-Rainbow: led coordinates wrong

When trying to light up the right leds on the mini-Rainbow (8x4) with Python with x and y positions and set_pixel, both x and y seem to have a range with the length of 8 (0-7). Each second row of 4 leds seems to be a continuation of the first row of 4 leds.
Example:

import time
import rainbowhat as rainbow

rainbow.set_layout(rainbow.PHAT)
rainbow.rotation(0)
rainbow.brightness(0.3)

for x in range(8):
    for y in range(4):
        rainbow.set_pixel(x,y,255,255,255)
        rainbow.show()
        time.sleep(1)

video1

Playing with rotation doesn't help. I'm using set_layout to set it to PHAT.

Example 2 (with rotation):

import time
import rainbowhat as rainbow

rainbow.set_layout(rainbow.PHAT)
rainbow.rotation(90)
rainbow.brightness(0.3)

for x in range(4):
    rainbow.set_pixel(x,0,255,255,255)
    rainbow.show()
    time.sleep(1)

for x in range(4):
    rainbow.set_pixel(x,1,255,0,0)
    rainbow.show()
    time.sleep(1)

results in this:

video2

ws2811_init failed with code -1

Traceback (most recent call last):
File "demo.py", line 7, in
import rainbowhat as rainbow
File "build/bdist.linux-armv7l/egg/rainbowhat.py", line 17, in
File "build/bdist.linux-armv7l/egg/neopixel.py", line 114, in begin
RuntimeError: ws2811_init failed with code -1
Exiting cleanly

neopixel

sudo python demo.py
Traceback (most recent call last):
File "demo.py", line 7, in
import rainbowhat as rainbow
File "build/bdist.linux-armv7l/egg/rainbowhat.py", line 4, in
ImportError: No module named neopixel

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.