menu to show readings from any of available sensors;
mode for rotating screen depending on gyro readings;
emulator of SenseHat LED matrix for Web;
Kalman filtering for accelerometer/gyro/magnetometer;
add analog clock demo app.
Usage
Instantiating
// Look over all frame buffer devices in `/dev/` for one of Sense Hat.
// Use default orientation `.up`
guard let senseHat = SenseHat() else {
fatalError("Can't initialise Raspberry Pi Sense Hat")
}
Parameter orientation could be used for other orientations” SenseHat(orientation: .left).
Parameter frameBufferDevice could be use for specific frame buffer device: SenseHat(frameBufferDevice: "/dev/fb0").
Both parameters could be used: SenseHat(frameBufferDevice: "/dev/fb0", orientation: .down).
Parameter orientation defines where top of the LED matrix will be. Here are example of the same character "1" shown with different orientations:
.up
.left
.right
.down
Set all LEDs of matrix to specific color
senseHat.set(color: .red) // sets all LEDs of matrix to red
senseHat.set(color: .black) // sets all LEDs of matrix to black, literally turns them off
Set specific LED of matrix to specific color
senseHat.set(color: .black) // clear
senseHat.set(x: 0, y: 0, color: .white) // set most top left LED to white using function syntax
senseHat[7, 7] = .green // set most bottom right LED to green using subscript syntax
Swift package
SenseHatfor Raspberry Pi Sense HatFeatures:
TODO:
Usage
Instantiating
Parameter
orientationcould be used for other orientations”SenseHat(orientation: .left). ParameterframeBufferDevicecould be use for specific frame buffer device:SenseHat(frameBufferDevice: "/dev/fb0"). Both parameters could be used:SenseHat(frameBufferDevice: "/dev/fb0", orientation: .down).Parameter orientation defines where top of the LED matrix will be. Here are example of the same character
"1"shown with different orientations:.up.left.right.downSet all LEDs of matrix to specific color
Set specific LED of matrix to specific color
Coordinates
xandyshould belong to0..<7range.Show character on LED matrix
Show string on LED matrix
Reading humidity sensor
Reading pressure sensor
Useful links
Unfortunately Data sheet or Programmer’s manual for Raspberry Pi Sense Hat doesn’t exist or I have failed to find it. Here are some useful links:
Rgb565;