Sense Hat Library Documentation ¶ Company : CODESYS Title : Sense Hat Version : 4.10.0.0 Categories : Target Namespace : SenseHat Author : CODESYS Development GmbH Placeholder : SenseHat Description [ 1 ] ¶ Library containing device support for the Sense Hat under Raspberry Pi. Contents: ¶ Gamma (Alias) JoystickEvent (Enum) JoystickInput (Struct) JoystickKey (Enum) JoystickState (Enum) ODR (Struct) PutInto180 (Function) SenseHat (FunctionBlock) Fb_Exit (Method) GammaReset (Method) GetGamma (Method) GetRecommendedODRSetting (Method) Gyroscope LowLight (Method) SetGamma (Method) connector status fmod (Function) Indices and tables ¶ [ 1 ] Based on Sense Hat.library, last modified 25.10.2023, 14:09:25. LibDoc 4.4.0.0-b.37 The content file Sense Hat.clean.json was generated with CODESYS V3.5 SP16 Patch 3 on 25.10.2023, 14:09:27.
Gamma (ALIAS) ¶ TYPE Gamma : ARRAY[0..31] OF USINT
JoystickEvent (ENUM) ¶ TYPE JoystickEvent : Attributes: qualified_only InOut: Name Initial EV_KEY 1 NONE 0
JoystickInput (STRUCT) ¶ TYPE JoystickInput : STRUCT InOut: Name Type dwTimeSec DWORD dwTimeUSec DWORD eEvent JoystickEvent eKey JoystickKey eState JoystickState
JoystickKey (ENUM) ¶ TYPE JoystickKey : Attributes: qualified_only InOut: Name Initial KEY_UP 103 KEY_LEFT 105 KEY_RIGHT 106 KEY_DOWN 108 KEY_ENTER 28 NONE 0
JoystickState (ENUM) ¶ TYPE JoystickState : Attributes: qualified_only InOut: Name Initial STATE_RELEASE 0 STATE_PRESS 1 STATE_HOLD 2
ODR (STRUCT) ¶ TYPE ODR : STRUCT InOut: Name Type rSampleRate REAL udiInterval UDINT
PutInto180 (FUN) ¶ FUNCTION PutInto180 : LREAL move an angle (DEG) into the area ]-180..180] InOut: Scope Name Type Return PutInto180 LREAL Input lrX LREAL
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: GyroXCalibrated GyroXIntegral GyroYCalibrated GyroYIntegral GyroZCalibrated GyroZIntegral Operational Methods: Fb_Exit GammaReset GetGamma GetRecommendedODRSetting LowLight SetGamma AfterReadInputs BeforeWriteOutputs Structure: Fb_Exit (Method) GammaReset (Method) GetGamma (Method) GetRecommendedODRSetting (Method) Gyroscope GyroXCalibrated (Property) GyroXIntegral (Property) GyroYCalibrated (Property) GyroYIntegral (Property) GyroZCalibrated (Property) GyroZIntegral (Property) LowLight (Method) SetGamma (Method) connector AfterReadInputs (Method) BeforeWriteOutputs (Method) status Operational (Property)
SenseHat.Fb_Exit (METH) ¶ METHOD Fb_Exit : BOOL InOut: Scope Name Type Comment Return Fb_Exit BOOL Input bInCopyCode BOOL TRUE: The exit method is called in order to leave the instance, which will be copied afterwards (Online-Change).