SenseHat (FB)

FUNCTION_BLOCK SenseHat EXTENDS i2c

This Function Block is instanciated along with the Sense Hat device of the raspberry PI. It’s inputs and outputs allow to easily access the sensors, inputs and LED outputs of the Sense Hat Device.

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

usiAddress

USINT

i2c

adwPixel

ARRAY [0..63] OF DWORD

Pixel array for LED-Output of Sensehat (0..7 Row 1, 8..17 Row 2, etc.). Use 32Bit ARGB color coding to set the color of each pixel.

xUpdatePixel

BOOL

TRUE

Update Pixel Output: default TRUE

xUpdateJoystick

BOOL

TRUE

Update Joystick Input: default TRUE

xUpdateLSM9DS1

BOOL

TRUE

Update LSM9DS1 Input: default TRUE

xUpdateAccelerometer

BOOL

TRUE

xUpdateGyroscope

BOOL

TRUE

xUpdateMagnetometer

BOOL

TRUE

xUpdateHTS221

BOOL

TRUE

Update HTS221 Input: default TRUE

xUpdateLPS25H

BOOL

TRUE

Update LPS25H Input: default TRUE

Output

xJoystickUp

BOOL

FALSE

Joystick input interpretated in senses of the given booleans

xJoystickDown

BOOL

FALSE

xJoystickLeft

BOOL

FALSE

xJoystickRight

BOOL

FALSE

xJoystickEnter

BOOL

FALSE

rTemperatureHTS221

REAL

Temperature of HTS221 in degree celcius (°C).

rHumidity

REAL

Humidity of HTS221 in percent of 100 (%).

rTemperatureLPS25H

REAL

Temperature of LPS25H in degree celcius (°C).

lrPressure

LREAL

Pressure of LPS25H in hecto pascal (hPA).

rGyroX

REAL

Gyroscope X direction data of LSM9DS1 (dps - degree per second)

rGyroY

REAL

Gyroscope Y direction data of LSM9DS1 (dps - degree per second)

rGyroZ

REAL

Gyroscope Z direction data of LSM9DS1 (dps - degree per second)

lrGyroYIntegral

LREAL

integral of Gyroscope X direction data of LSM9DS1 [°]

lrGyroXIntegral

LREAL

integral of Gyroscope Y direction data of LSM9DS1 [°]

lrGyroZIntegral

LREAL

integral of Gyroscope Z direction data of LSM9DS1 [°]

aiMagRaw

ARRAY [0..2] OF INT

raw values of magnet, gyroscope, accelerometer

aiGyrRaw

ARRAY [0..2] OF INT

aiAccRaw

ARRAY [0..2] OF INT

arGyrCalib

ARRAY [0..2] OF REAL

calibration data (average offset to 0

arAccCalib

ARRAY [0..2] OF REAL

udiAccSamples

UDINT

number of accelerometer samples

udiGyrSamples

UDINT

number of gyroscope samples

rAccelX

REAL

Acceleration X direction data of LSM9DS1 (G ~ 9,81 m/s^2)

rAccelY

REAL

Acceleration Y direction data of LSM9DS1 (G ~ 9,81 m/s^2)

rAccelZ

REAL

Acceleration Z direction data of LSM9DS1 (G ~ 9,81 m/s^2)

lrAccelXIntegral

LREAL

Acceleration X direction data of LSM9DS1 [m/s]

lrAccelYIntegral

LREAL

Acceleration Y direction data of LSM9DS1 [m/s]

lrAccelZIntegral

LREAL

Acceleration Z direction data of LSM9DS1 [m/s]

rCompX

REAL

Compass X direction data of LSM9DS1 (microTesla)

rCompY

REAL

Compass Y direction data of LSM9DS1 (microTesla)

rCompZ

REAL

Compass Z direction data of LSM9DS1 (microTesla)

Properties:

Methods:

Structure: