Create a Sense HAT object passing raspi object
returns a
sensehat object for the SenseHAT connected to the Raspberry Pi™ board. Using the sensehat object, you can use the Humidity sensor, Pressure
sensor, IMU sensor, read the joystick status, and control the LED Matrix.mysh
= sensehat(mypi
)
SenseHAT is reserved for a single use at the time of object creation. Once an object is created for the SenseHAT, mysh in the example below, you can treat the SenseHAT as if it is connected to the host computer.
You cannot create multiple objects that refer to the same SenseHAT. You can create multiple SenseHAT objects provided that they are connected to different Raspberry Pi boards.
Use the senseHAT object to read values from different sensors as follows:
Humidity Sensor readHumidity
.
Pressure Sensor readPressure
.
Temperature Sensor readTemperature
.
IMU Sensor:
Read the angular velocity measured by GyroscopereadAngularVelocity
.
Read the acceleration measured by Accelerometer readAcceleration
.
Read the magnetic field measured by MagnetometerreadMagneticField
.
LED Matrix:
Write pixel writePixel
.
Display an image displayImage
.
Display message displayMessage
.
Clear LED Matrix clearLEDMatrix
.
Joystick - Read the joystick statusreadJoystick
.
clearLEDMatrix
| displayImage
| displayMessage
| raspi
| readAcceleration
| readAngularVelocity
| readHumidity
| readJoystick
| readMagneticField
| readPressure
| readTemperature
| sensehat
| writePixel