Skip to content

Latest commit

 

History

History

PimoroniButtonShim

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Install Pimoroni Button SHIM on Raspberry PI

With Pimoroni Button SHIM device you can have fast and easily 5 physical buttons and one LED on your device. What you do with it is up to you, the possibilities are almost unlimited.

Objective

The aim of this tutorial is to describe the configuration of Raspberry PI, the installation of the necessary software. Additional a tiny test whether everything is ready for further development.

Attention: You have to solder the components beforehand, this is not described here!

Button Shim on Flirc Case

My Button SHIM on Raspberry Pi Zero and Flirc Case.

Precondition

You should already have read (and successful carried out) the following tutorials.

Install needed and/or optional packages

Install (or ensure they are installed) following packages.

# update system (optional)
$ sudo apt update -y && sudo apt upgrade -y

Button SHIM

Preparation

Enable the I2C interface on the Raspberry Pi.

# start console based raspi-config application
$ sudo raspi-config

Enable I2C

Select Interfacing Options, next I2C and activate <Yes>.

Install Python Button SHIM

# install button shim package
$ sudo apt install -y python3-buttonshim

Test the device

# start python console
$ python3

Test the device LED.

# import button shim library
>>> import buttonshim

# LED light up red
>>> buttonshim.set_pixel(0xff, 0x00, 0x00)

# LED light up green
>>> buttonshim.set_pixel(0x00, 0xff, 0x00)

# LED light up blue
>>> buttonshim.set_pixel(0x00, 0x00, 0xff)

# exit python console
>>> exit()

Note: Read this documentation to get more information, or have a look on these GitHub examples to start faster.

Go Back