/rpi-sense-hat-java

Java Wrapper for Raspberry Pi Sense Hat

Primary LanguageJava

Java Wrapper for Raspberry Pi Sense Hat

Simple Java wrapper for Sense Hat which allows to write various applications in any JVM language

Supported components

  • Environmental sensors
  • IMU (inertial measurement unit)
  • LED Matrix
  • Joystick (only blocking operation, must be used in separate thread)

Usage

# On RPi
./gradlew clean build

# On different platform
./gradlew clean build -x test
  • Copy build/libs/java-executor-1.0-SNAPSHOT.jar into your project classpath
  • Alternatively it's possible to edit rpi.sense.hat.example.Project and run on RPi
./gradlew run

or as simple background process

nohup ./gradle run &

API

SenseHat senseHat = new SenseHat();

senseHat.environmentalSensor.<method>
senseHat.IMU.<method>
senseHat.ledMatrix.<method>
senseHat.joystick.<method>