ws2811ext

package module
v0.0.0-...-3b55a02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

README

Go-WS281x-RPi

Library written in Go to allow controlling of the WS281x LED strips on a Raspberry Pi.

Usage

This needs quite a few steps, so try keep up!

First, grab the C library

  1. sudo apt-get update (update RPi's software)

  2. sudo apt-get install scons gcc git (get needed packages)

  3. We need to disable the audio, due to PCM

    sudo nano /etc/modprobe.d/snd-blacklist.conf

    and add this into file

    blacklist snd_bcm2835

  4. We need to edit configuration of RPi

    sudo nano /boot/config.txt

    and then add a # in front of

    dtparam=audio=on

    to comment it out.

    For headless, you may also need to add the following two line to config.txt

    hdmi_force_hotplug=1 hdmi_force_edid_audio=1

  5. sudo reboot

  6. go get github.com/rpi-ws281x/rpi-ws281x-go so that the go/src/github.com directory is created.

    => An error will likely occur if https://github.com/jgarff/rpi_ws281x is not installed.

  7. browse to go/src/github.com and then create the jgarff directory with mkdir jgarff if it doesn't exist.

  8. browse to go/src/github.com/jgarff and type git clone https://github.com/jgarff/rpi_ws281x (the C library that drives the LEDs)

  9. browse to go/src/github.com/jgarff/rpi_ws281x github repo and type scons to compile library

  10. copy *.h files to /usr/local/include

    sudo cp *.h /usr/local/include

  11. copy *.a files to /usr/local/lib

    sudo cp *.a /usr/local/lib

  12. go get github.com/rpi-ws281x/rpi-ws281x-go go get github.com/adrianh-za/go-ws281x-rpi go get github.com/adrianh-za/go-utils/colorsys

  13. browse to $/go/src/github.com/adrianh-za/go-ws281x-rpi/examples

  14. sudo -E go run [filename].go (check filenames below)

  15. ctrl-c to quit

Some extra help

Connect and Control WS2812 RGB LED Strips via Raspberry Pi

Example filenames

** The filename contains the LED matrix size

  • clear-8x4.go
  • clear-8x8.go
  • colours-8x4.go
  • colours-8x8.go
  • happy-8x8.go
  • heart-8x8.go
  • hw.go
  • kitt-8x4.go
  • kitt-8x8.go
  • rainbow-8x4.go
  • rainbow-8x8.go
  • rainbow-snake-8x4.go
  • rainbow-snake-8x8.go

Acknowledgements

Utilises the WS281x library written by Jeremy Garff

Borrows heavily from the work done by Jacques Supcik

Gits

https://github.com/jgarff/rpi_ws281x

https://github.com/rpi-ws281x/rpi-ws281x-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearAll

func ClearAll(ws2811 *ws2811.WS2811, channel int)

ClearAll clears all the leds (sets to 0x0000000) for matrix

func SetAll

func SetAll(ws2811 *ws2811.WS2811, channel int, color uint32)

SetAll sets all the leds for matrix to the specified color

func SetupExit

func SetupExit(ws2811 *ws2811.WS2811, channel int, clear bool)

func WaitRender

func WaitRender(ws2811 *ws2811.WS2811) error

WaitRender first waits and then renders

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL