JavaFX UI + Arduino project to control the lights and LED strips in a drum booth.
This project combines multiple examples of the book "Getting started with Java on Raspberry Pi". The sources of the examples in this book are freely available on GitHub. For more info see "Drumbooth controller with Raspberry Pi and JavaFX".
- USB cable between both boards (for serial communication)
- 5V and ground from power supply to Pi, Arduino and LED strips
- Control cable between pins 6, 7 and 8 to each of the three LED strips
The commands shared between both boards are strings in the structure “COMMAND_ID:SPEED:R1:G1:B1:R2:G2:B2”, where the command ID is one of the following options:
Build and copy the files to your Raspberry Pi
$ mvn clean package
$ scp target/drumbooth-0.0.1 pi@drumbooth.local://home/pi/drumbooth
$ scp scripts/start.sh pi@drumbooth.local://home/pi/drumbooth
- Install Pi4J v1 and WiringPi
$ curl -sSL https://pi4j.com/install | sudo bash
$ sudo pi4j --wiringpi
- Copy this file to the Pi: "drumbooth-0.0.1-jar-with-dependencies.jar"
- Install Java 11 on the Raspberry Pi if needed (with SDKMAN), we must use
sudo sdk install
to make the Java available for the sudo-user that also needs to be used to start the Pi4J application.
$ sudo apt install zip
$ curl -s "https://get.sdkman.io" | bash
$ sudo sdk install java 11.0.13-zulu
- Download the JavaFX runtime
$ wget -O openjfx.zip https://gluonhq.com/download/javafx-17-ea-sdk-linux-arm32/
$ unzip openjfx.zip
$ sudo mv javafx-sdk-17/ /opt/javafx-sdk-17/
- Run with the included script which can also be used at startup of the Pi to automatically launch the application
sudo bash /home/pi/drumbooth/start.sh
Settings to be added to config.txt
max_usb_current=1
hdmi_force_hotplug=1
config_hdmi_boost=10
hdmi_group=2
hdmi_mode=87
hdmi_cvt 1024 600 60 0 0 0
http://wiki.openmusiclabs.com/wiki/ArduinoFHT http://wiki.openmusiclabs.com/wiki/FHTExample
Controls three WS2812 LED strips with the same effect. Code is separated into multiple file so it's easier to understand and maintain.