1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pi-blaster

Introduction

Pi-Blaster is a library that uses software PWM to drive a number of LEDs using Raspberry Pi GPIOs.

NOTE; if you have used this prior to May 2016 you will need to update the configuration as the syntax and options have changed.

Setup

You need to have downloaded and configured pi-blaster from
https://github.com/sarfata/pi-blaster

pi-blaster needs to be given the list of GPIO's that it's allowed to use
Code:
pi-blaster --gpio 4,17,18,27,21,22,23,24,25,10,9,11
The device options in your Hyperion configuration file Must specify the pi-blaster fifo to write to and the mapping between Hyperion led indexes and the gpio pins.

Here is a sample configuration that used 4 * 4pin RGB LEDs. It has a more complex structure than most led device types

Code:
"device" :
{
   "name"  : "MyPi",
   "type"  : "piblaster",
   "output"  : "/dev/pi-blaster",   // This is the pi-blaster fifo to write to
   "gpiomap"  :
   [
     { "gpio" : 4, "ledindex" : 0, "ledcolor" : "r" },   // GPIO 4 gets the red component of hyperion led 0
     { "gpio" : 17, "ledindex" : 0, "ledcolor" : "g" },   // GPIO17 gets the green component of hyperion led 0
     { "gpio" : 18, "ledindex" : 0, "ledcolor" : "b" },   // GPIO18 gets the blue component of hyperion led 0
     { "gpio" : 27, "ledindex" : 1, "ledcolor" : "r" },
     { "gpio" : 21, "ledindex" : 1, "ledcolor" : "g" },
     { "gpio" : 22, "ledindex" : 1, "ledcolor" : "b" },
     { "gpio" : 23, "ledindex" : 2, "ledcolor" : "r" },
     { "gpio" : 24, "ledindex" : 2, "ledcolor" : "g" },
     { "gpio" : 25, "ledindex" : 2, "ledcolor" : "b" },
     { "gpio" : 10, "ledindex" : 3, "ledcolor" : "w" },   // GPIO10 gets the white component (average of r,g,b) of hyperion led 3
     { "gpio" : 09, "ledindex" : 4, "ledcolor" : "w" },   // GPIO 9 gets the white component of hyperion led 3
     { "gpio" : 11, "ledindex" : 5, "ledcolor" : "w" }   // GPIO11 gets the white component of hyperion led 3

   ]
},

Generally you would only need to change the gpiomap and keep the rest default,


Hardware

The hardware setup is very much DIY.
In my case for testing I had 4 * 4 pin RGB LEDs with current limiting resistors

This page has been seen 5,141 times.