Qwiic LED Stick - APA102C Hookup Guide

Pages
Contributors: El Duderino, MAKIN-STUFF
Favorited Favorite 1

Qwiic LED Stick Python Package

Note: This package and the included examples assume you are using the latest version of Python 3. If this is your first time using Python or I2C hardware on a Raspberry Pi, these tutorial can help you get started:

The Qwiic LED Python package is a port of the Arduino library for users who prefer to use this board with a Raspberry Pi. The Python port includes the same eleven examples as the Arduino library to get you started from simply turning on the LEDs to creating some nifty light displays.

The package is hosted on PyPi to make installation quick and painless using simple commands in the command interface. If you prefer to manually install the package, you can find it on the GitHub repository or click the button below to download the ZIP of it:

(*Please be aware this package depends on the Qwiic I2C Driver. You can also check out the repository documentation page, hosted on Read the Docs.)

Qwiic LED Stick Py Installation

Let's go over both installation methods for the Qwiic LED Stick Python package.

Note: Don't forget to double check that the hardware I2C connection is enabled on your Raspberry Pi or other single board computer. The Raspberry Pi tutorials linked in the note above cover how to enable the Pi's I2C bus.

PyPi Installation

Hosting the package on PyPi makes installation simple on systems that support PyPi installation via pip3 (use pip for Python 2). Open a command interface and enter the following commands:

For all users (The user must have sudo privileges) privileges):

language:bash
sudo pip3 install sparkfun-qwiic-led-stick

For the current user:

language:bash
pip3 install sparkfun-qwiic-led-stick

Local Installation

Follow these instructions for a local installation. Make sure to install the setuptools package prior to installing the Qwiic LED Stick package.

Use this command for direct installation at the command line (use python for Python 2):

language:bash
python3 setup.py install

Build a package for use with pip3:

language:bash
python setup.py sdist

This command builds and places a subdirectory called "dist". Change to the new subdirectory and install the Qwiic LED Stick package using pip3 with these commands (make sure to fill in the correct version number):

language:bash
cd dist
pip3 install sparkfun_qwiic_led_stick-<version>.targ.gz

Qwiic LED Stick Python Package Operation

A complete overview of all the functions included in the Qwiic LED Stick Py is hosted on the ReadtheDocs. You can also take a look at the source code.

Upgrading the Qwiic LED Stick Python Package

In case the package is updated in the future, you may need to upgrade it. Use these commands to upgrade the package:

For all users (The user must have sudo privileges):

language:bash
sudo pip3 install --upgrade sparkfun-qwiic-led-stick

For the current user:

language:bash
pip3 install --upgrade sparkfun-qwiic-led-stick