sensehat
Create a Sense HAT object passing raspi object
Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.
Syntax
Description
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 Gyroscope
readAngularVelocity
.Read the acceleration measured by Accelerometer
readAcceleration
.Read the magnetic field measured by Magnetometer
readMagneticField
.
LED Matrix:
Write pixel
writePixel
.Display an image
displayImage
.Display message
displayMessage
.Clear LED Matrix
clearLEDMatrix
.
Joystick - Read the joystick status
readJoystick
.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2016b
See Also
raspi
| readHumidity
| readPressure
| readTemperature
| readAngularVelocity
| readAcceleration
| readMagneticField
| writePixel
| displayImage
| displayMessage
| clearLEDMatrix
| readJoystick