Difference between revisions of "Component: Joystick (Sparkfun Quiic) (Analog Input)"
From Flowcode Help
Jump to navigationJump to search(9 intermediate revisions by one other user not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx] |
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
Line 35: | Line 37: | ||
− | |||
− | |||
Line 45: | Line 45: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ''No detailed description exists yet for this component'' | ||
+ | |||
+ | ==Examples== | ||
Line 54: | Line 61: | ||
− | |||
− | |||
− | = | + | ''<span style="color:red;">No additional examples</span>'' |
+ | ==Macro reference== | ||
+ | |||
+ | ===ChangeI2CAddress=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 78: | Line 86: | ||
+ | ===CheckButton=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 91: | Line 100: | ||
+ | ===Initialise=== | ||
{| 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;" | '''Initialise''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Initialises the I2C bus ready for communications with the module. |
|- | |- | ||
|- | |- | ||
− | + | | 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- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ReadAxis=== | ||
{| 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;" | '''ReadAxis''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Reads a single axis of the joystick and returns as a signed integer value. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | Axis |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range 0-1 Where 0=X, 1=Y |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
− | | width="90%" | | + | | width="90%" | Type |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023) |
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ReadButton=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 153: | Line 150: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 182: | Line 164: | ||
|- | |- | ||
| colspan="2" | Decides if the joystick automatically returns to the center position when released. Yes: The joystick will return to the center when released. No: The joystick will remain in the current position when released. | | colspan="2" | Decides if the joystick automatically returns to the center position when released. Yes: The joystick will return to the center when released. No: The joystick will remain in the current position when released. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
| width="90%" | Device Address | | width="90%" | Device Address | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | External device address used to communicate with the module. Default 32 or 0x20 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
Line 244: | Line 183: | ||
|- | |- | ||
| colspan="2" | Baud rate option selector | | colspan="2" | Baud rate option selector | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | Baud Rate | ||
+ | |- | ||
+ | | colspan="2" | Baud rate to be used | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
Line 249: | Line 193: | ||
|- | |- | ||
| colspan="2" | Pin used for SDA (data signal) | | colspan="2" | Pin used for SDA (data signal) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
Line 259: | Line 198: | ||
|- | |- | ||
| colspan="2" | Pin used for SCL (clock signal) | | colspan="2" | Pin used for SCL (clock signal) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 277: | Line 211: | ||
| width="90%" | Simulate Comms | | width="90%" | Simulate Comms | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Controls if we are using the panel simulation or simulating the I2C calls for use with an I2C injector. |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 292: | Line 226: | ||
| width="90%" | API | | width="90%" | API | ||
|- | |- | ||
− | | colspan="2" | Specifies the | + | | colspan="2" | Specifies the injector component on the panel to interact with to provide comms simulation. |
|} | |} |
Latest revision as of 14:27, 23 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Analog Input |
Contents
Joystick (Sparkfun Quiic) component
An XY sprung joystick with click switch allowing for easy user input control. Connected using I2C bus.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
ChangeI2CAddress
CheckButton
![]() |
CheckButton |
Checks to see if the button has been pressed since the last read of CheckButton or ReadButton. | |
![]() |
Return |
Initialise
![]() |
Initialise |
Initialises the I2C bus ready for communications with the module. | |
![]() |
Return |
ReadAxis
![]() |
ReadAxis |
Reads a single axis of the joystick and returns as a signed integer value. | |
![]() |
Axis |
Range 0-1 Where 0=X, 1=Y | |
![]() |
Type |
0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023) | |
![]() |
Return |
ReadButton
![]() |
ReadButton |
Checks to see if the button is currently pressed | |
![]() |
Return |