Project

blinkt

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby Library for Blinkt; 8 APA102 LEDs for your Raspberry Pi https://shop.pimoroni.com/products/blinkt
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.3.0, ~> 0.3
 Project Readme

Blinkt!

A Ruby port of the Pimoroni Blinkt Python library.

Gem Version

Blinkt provides eight super-bright RGB LED indicators, ideal for adding visual notifications to your Raspberry Pi on their own or on a pHAT stacking header.

Available from Pimoroni: https://shop.pimoroni.com/products/blinkt

Installation

The Blinkt library can be installed from Rubygems:

# gem install blinkt

Usage

The two Blinkt methods you'll most commonly use are set_pixel and show. Here's a simple example:

require 'blinkt'

set_pixel(0,255,0,0)
show

set_pixel takes an optional fifth parameter; the brightness from 0.0 to 1.0.

set_pixel(pixel_no, red, green, blue, brightness)

You can also change the brightness with set_brightness from 0.0 to 1.0, for example:

require 'blinkt'

set_brightness(0.5)
show

It is also possible to clear any already lit pixels with clear, set all pixels at once with set_all and to have all pixels clear on exit with set_clear_on_exit.

require 'blinkt'

clear
set_clear_on_exit
set_all(255,0,0)
show

set_all takes an optional fourth parameter; the brightness from 0.0 to 1.0.

set_all(red, green, blue, brightness)

Examples

The examples in the examples folder should just work with Blinkt!

Version Information

The Ruby Blinkt gem version corresponds to the Python lib versions in the following table:

Ruby Gem Version Python Lib Version
0.0.3 0.1.0