This is a project to construct and build a word clock using a raspberry pi zero and the adafruid neopixels. This project is currently in progress. The repository will document the current work.
To use the the great library rpi_ws291x this project adds a Java-Wrapper.
- Raspberry Pi Zero (W)
- XP Power ECE60US05 AC/DC converter 5V 60W
- 74AHCT125 Level Converter
- Adafruit NeoPixel Digital RGBW LED Strip
The wiring is done how it is explained in the adafruit guide This is my result for the demo:
-
Setup an evironment where the pi is accessible through ssh. There are several guides on the web that explain how to setup the pi.
-
Assigning PWM0 and PWM1 pins to GPIO 18 and 13. The NeoPixel protocol will be controlled by the raspi's sound output. To make the raspi ouput the signal to the GPIO 18 and 13, we need to digitally wire them up. These steps are copied from this guide
sudo apt-get updatesudo apt-get install git-coregit clone git://git.drogon.net/wiringPicd ~/wiringPi./build- test the installation with
gpio -v - Copy the gpio_alt.c code from this repo to your folder on the pi
gcc -o gpio_alt gpio_alt.csudo chown root:root gpio_altsudo chmod u+s gpio_altsudo mv gpio_alt /usr/local/bin/- now the script to wire up the GPIO has been compiled and installed
- wire them up
gpio_alt -p 13 -f 0gpio_alt -p 18 -f 5
-
Now the pi is setup to output your signals to the stripe. To test the wiring and setup clone the rpi_ws281x repository and run the test
sudo apt-get install sconshttps://github.com/jgarff/rpi_ws281xcd rpi_ws281xnano main.cChange the strip height to1and the width to something like100and set theSTRIP_TYPEtoSK6812_STRIP_RGBWsconsthis runs the compilersudo ./testyou should see a running led snake
-
If the test was successful add the java wrapper to code the clock
scons .to compile the so file and copylibws2811.soto/usr/local/bin/libws2811.sowithsudo cp ~/rpi_ws281x/libws2811.so /usr/local/bin/libws2811.so- install java 8
sudo apt-get install oracle-java8-jdk - execute
mv compile assembly:singlefrom inside the root of this repo and copyout/build/ws2811.jarto the raspi. - run
java -cp ws2811.jar de.konsultaner.demo.Main - Result:
