Create a Sense HAT object passing raspi object
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(
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:
Create SenseHAT object
You can create SenseHAT object passing raspi (Raspberry Pi) object as the first parameter to the constructor. Using this sensehat object, you can read the values from the sensors on-board, read the status of the job stick, and write to the LED Matrix.
Create a SenseHAT object
from the MATLAB® software to the SenseHAT Board.
mysh = sensehat(mypi);
This function creates a senseHAT object ‘mysh’ for the SenseHAT connected to a Raspberry Pi board.
mysh — Connection to Raspberry Pi SenseHAT board
Sense HAT object
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
You can also deploy
sensehaton the Raspberry Pi hardware in MATLAB Online™.
Introduced in R2016b