Skip to content

Python Library for Blinkt; 8 APA102 LEDs for your Raspberry Pi

License

Notifications You must be signed in to change notification settings

pimoroni/blinkt

Repository files navigation

Blinkt!

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

We've created a super-easy installation script that will install all pre-requisites and get your Blinkt! up and running in a jiffy. To run it fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop like so:

Finding the terminal

In the new terminal window type:

curl -sS get.pimoroni.com/blinkt | bash

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

##Usage

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

from blinkt import set_pixel, show

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:

from blinkt import set_brightness

set_brightness(0.5)
show()

##Examples

The examples in the examples folder should just work with Blinkt!, although you'll need to add Twitter developer access tokens and secrets in the twitter_monitor.py example. You can get these at https://dev.twitter.com/, after setting up a new application.

The examples in the examples/extra_examples folder are designed to work with other pHATs and HATs, so be aware of that before trying them.