Created
January 1, 2020 10:06
-
-
Save kmizu/bc360bad5cf1d125136d090776f43369 to your computer and use it in GitHub Desktop.
Code snippet to control Raspberry Pi from Scala (sbt console)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalaVersion := "2.13.1" | |
name := "pi4r" | |
version := "0.0.1-SNAPSHOT" | |
libraryDependencies ++= Seq( | |
"com.pi4j" % "pi4j-core" % "1.2", | |
"com.pi4j" % "pi4j-device" % "1.2", | |
"com.pi4j" % "pi4j-gpio-extension" % "1.2", | |
"com.pi4j" % "pi4j-service" % "1.1", | |
"com.pi4j" % "pi4j-native" % "1.2" pomOnly() | |
) | |
initialCommands in console += { | |
Iterator( | |
"com.pi4j.io.gpio._", | |
"com.pi4j.wiringpi._" | |
).map("import "+).mkString("\n") + "\n" + | |
"Gpio.wiringPiSetupGpio()\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment