Difference between revisions of "Component: Sense Hat (Raspberry Pi Hat)"
From Flowcode Help
Jump to navigationJump to searchLine 59: | Line 59: | ||
{{Fcfile|RPISenseHat.fcfx|RPI Sense HAT}} | {{Fcfile|RPISenseHat.fcfx|RPI Sense HAT}} | ||
+ | |||
+ | |||
Line 65: | Line 67: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===ReadJoystick=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 78: | Line 81: | ||
+ | ===SetPixel=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 116: | Line 120: | ||
+ | ===SetAll=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 144: | Line 149: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:52, 3 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Raspberry Pi Hat |
Contents
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.
Macro reference
ReadJoystick
![]() |
ReadJoystick |
Reads the joystick Returns the direction as a bit field. 1 = Down / 2 = Right / 4 = Up / 8 = Click / 16 = Left | |
![]() |
Return |
SetPixel
![]() |
SetPixel |
Seta the colour of a single pixel | |
![]() |
X |
![]() |
Y |
![]() |
R |
![]() |
G |
![]() |
B |
![]() |
Return |
SetAll
![]() |
SetAll |
Sets all pixels to a specific colour | |
![]() |
R |
![]() |
G |
![]() |
B |
![]() |
Return |
Initialise
![]() |
Initialise |
Initialises the I2C peripheral ready for communications. | |
![]() |
Return |