This is a simple project skeleton for developing with the Pi4J library on the Raspbery Pi using Scala 2.10 and SBT.
Running sbt assembly
will create a single self-executing JAR which contains the required libraries for interfacing with the Pi hardware, in particular its GPIO pins. The resulting JAR can be SCPed to the Pi and run with sudo java -jar pi-workshop.jar
(the sudo
is needed for the required priviledges to use the Pi hardware).
you@your-machine $ sbt assembly
you@your-machine $ scp target/scala-2.10/pi-workshop.jar [email protected]:~
you@your-machine $ ssh [email protected] #replace with IP for your Pi
pi@raspberrypi ~ $ sudo java -jar pi-workshop.jar