Difference between revisions of "Component: Sense Hat (Raspberry Pi Hat)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/RPI_SenseHat.fcfx FC_Comp_Source_temp/RPI_SenseHat.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/RPI_SenseHat.fcfx FC_Comp_Source_temp/RPI_SenseHat.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 59: | Line 59: | ||
{{Fcfile|RPISenseHat.fcfx|RPI Sense HAT}} | {{Fcfile|RPISenseHat.fcfx|RPI Sense HAT}} | ||
+ | |||
+ | |||
Line 66: | Line 68: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | ===Initialise=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Initialises the I2C peripheral ready for communications. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
===ReadJoystick=== | ===ReadJoystick=== | ||
Line 81: | Line 97: | ||
− | === | + | ===SetAll=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAll''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets all pixels to a specific colour |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 120: | Line 126: | ||
− | === | + | ===SetPixel=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPixel''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Seta the colour of a single pixel |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | X |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Y |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | R |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | + | | width="90%" | G |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | colspan="2" | |
− | |||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | B | ||
|- | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
Revision as of 12:02, 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_temp/RPI_SenseHat.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_temp/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
Initialise
![]() |
Initialise |
Initialises the I2C peripheral ready for communications. | |
![]() |
Return |
ReadJoystick
![]() |
ReadJoystick |
Reads the joystick Returns the direction as a bit field. 1 = Down / 2 = Right / 4 = Up / 8 = Click / 16 = Left | |
![]() |
Return |
SetAll
![]() |
SetAll |
Sets all pixels to a specific colour | |
![]() |
R |
![]() |
G |
![]() |
B |
![]() |
Return |
SetPixel
![]() |
SetPixel |
Seta the colour of a single pixel | |
![]() |
X |
![]() |
Y |
![]() |
R |
![]() |
G |
![]() |
B |
![]() |
Return |