Component: Sense Hat (Raspberry Pi Hat)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category Raspberry Pi Hat


Sense Hat component

A component to drive various features on the Raspberry Pi Sense Hat. Supported Features: 8x8 RGB LED / 5-Way Joystick

Component Source Code

Please click here to download the component source project: FC_Comp_Source_RPI_SenseHat.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_RPI_SenseHat.fcfx

Detailed description

No detailed description exists yet for this component

Examples

A simple example to sample the joystick and output a fixed colour to all 8 x 8 RGB LEDs. Pressing up on the joystick outputs blue to the LEDs and pressing down outputs red.

FC6 Icon.png RPI Sense HAT







Macro reference

Initialise

Fc9-comp-macro.png Initialise
Initialises the I2C peripheral ready for communications. 
Fc9-void-icon.png - VOID Return


ReadJoystick

Fc9-comp-macro.png ReadJoystick
Reads the joystick Returns the direction as a bit field. 1 = Down / 2 = Right / 4 = Up / 8 = Click / 16 = Left 
Fc9-u8-icon.png - BYTE Return


SetAll

Fc9-comp-macro.png SetAll
Sets all pixels to a specific colour 
Fc9-u8-icon.png - BYTE R
 
Fc9-u8-icon.png - BYTE G
 
Fc9-u8-icon.png - BYTE B
 
Fc9-void-icon.png - VOID Return


SetPixel

Fc9-comp-macro.png SetPixel
Seta the colour of a single pixel 
Fc9-u8-icon.png - BYTE X
 
Fc9-u8-icon.png - BYTE Y
 
Fc9-u8-icon.png - BYTE R
 
Fc9-u8-icon.png - BYTE G
 
Fc9-u8-icon.png - BYTE B
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png I2C
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Scope Traces
Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API