WS2812 Addressable LEDs: Raspberry Pi Quick-start Guide

www.pdf24.org    Send article as PDF   

This tutorial is aimed at getting some instant gratification from your WS2812 LEDs (trade name: neopixels). I’ll briefly cover a bare-bones setup for Raspberry Pi.

If you’ve never used a Raspberry Pi before, we’ve got you covered with our free, online Raspberry Pi How-To’s.Here’s the wiring used in the video (click for hi-res):

WS2812 Addressable LEDs with Raspberry Pi

First, install the Python support for WS2812B LEDs:

navigate to the examples directory

And that should be all there is to it! Your LEDs should be running the same pattern you see in the video.

Troubleshooting: If your LEDs only flicker erratically instead of performing a nice demo we need to make some edits to /boot/config.txt, execute:

and either uncomment or add the following lines:

save, reboot, and reattempt to run strandtest.py as above.

As always, if you have any troubles then reach out to us in the comments section below. I will do my best to help!

References

The one-line install command is just a simple script that automates the commands listed in Adafruit’s tutorial. Follow the link if you want to see what’s happening behind the scenes. To see the contents of the script before you run it, save it to a file with:

Adafruit Neopixel Uberguide

Jeremy Garff’s Github Repository – Issue #103

Previous Post

Temperature Sensing With Raspberry Pi

The Raspberry Pi lacks analogue input, and while it’s possible to use an Analogue to Digital Converter (ADC), the DS18B20 is a fantastic, easy to use digital sensor that uses ... Read more

Next Post
pHAT DAC for Raspberry Pi Zero

24-bit, 192KHz Audio for the Raspberry Pi Zero with the pHAT

The pHAT provides a super affordable high-quality DAC for your Raspberry Pi. It pumps out 24-bits at 192KHz from the Raspberry Pi's I2S interface on its 2x20 pin GPIO header. Use pHAT DAC ... Read more

Short URL: http://tinyurl.com/y87jdef7

One Response to WS2812 Addressable LEDs: Raspberry Pi Quick-start Guide

  1. Nick says:

    I have a 144 LED strip and can’t get it to work. Either it flickers very slightly or all the LEDs come on white and blind me! I changed the strandtest.py code variable LED_COUNT from 30 to 144 but no joy. Do I need to change something else, perhaps DMA ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Do NOT follow this link or you will be banned from the site!