mcuadros / go-rpi-ws281x

Go bindings for Raspberry Pi PWM library for WS281X LEDs
MIT License
41 stars 6 forks source link

No such file or directory: ws2811.h #2

Open chauss opened 3 years ago

chauss commented 3 years ago

Hey @mcuadros, I'm trying to use your module to get my led matrix attached to a rpi zero w running with golang.

Unfortunatly I run into this error when I run go get github.com/mcuadros/go-rpi-ws281x:

# github.com/mcuadros/go-rpi-ws281x
../go/pkg/mod/github.com/mcuadros/go-rpi-ws281x@v0.0.0-20180122015054-0d7c616b0b23/matrix.go:8:10: fatal error: ws2811.h: No such file or directory
 #include <ws2811.h>
          ^~~~~~~~~~
compilation terminated.

golang and scons are installed.

Would be nice if you could push me in the right direction to solve this issue. 👍

brnck commented 3 years ago

Clone https://github.com/jgarff/rpi_ws281x repository

Inside repository directory type scons

Copy compiled lib and rest of the includes:

cp ws2811.h /usr/local/include/ws2811.h && \
cp rpihw.h /usr/local/include/rpihw.h && \
cp pwm.h /usr/local/include/pwm.h && \
cp libws2811.a /usr/local/lib/libws2811.a