Julia package for the Raspberry Pi Sense HAT
Author JuliaBerry
12 Stars
Updated Last
2 Years Ago
Started In
October 2016



SenseHat.jl is a Julia library for interacting with the Raspberry Pi Sense HAT.

SenseHat.jl requires the Raspbian sense-hat package:

sudo apt-get update
sudo apt-get install sense-hat
sudo reboot

LED matrix

The main interface is the led_matrix() function, which creates an 8×8 array of RGB values (from ColorTypes.jl) which is memory-mapped to the frame buffer of the LED matrix. led_clear() is a convenience function for resetting the LED matrix to black.

using SenseHat
using ColorTypes

const LED = led_matrix()

LED[:] = SenseHat.JULIA_LOGO


In the Stick module there is readstick() which will block until the joystick is manipulated, returning a StickEvent:

using SenseHat

e = readstick()

For querying within a loop, use a Channel to create a buffer of StickEvent.

using SenseHat

c = Channel{StickEvent}(32)

@async while true
    put!(c, readstick())


humidity(), temperature() and pressure() will read values from the corresponding sensors.

The inertial measurement unit (IMU) is not yet supported, but is coming soon. In the meantime, you can use the python library via PyCall.jl.

Used By Packages

No packages found.