Jump to content

Component: Joystick (Sparkfun Quiic) 2D (Analog Input): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(13 intermediate revisions by 2 users not shown)
Line 5: Line 5:
|-
|-
| width="20%" style="color:gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0
| 10.0
|-
|-
| width="20%" style="color:gray;" | Category
| width="20%" style="color:gray;" | Category
Line 15: Line 15:
An XY sprung joystick with click switch allowing for easy user input control. Connected using I2C bus.
An XY sprung joystick with click switch allowing for easy user input control. Connected using I2C bus.


==Component Source Code==
==Version information==


Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx]
Library Version, Component Version, Date, Author, Info
10, 10.0, 04-12-24, MW,Icon edited so compatible with dark theme


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx]


==Detailed description==
==Detailed description==




Line 39: Line 43:




''<span style="color:red;">No additional examples</span>''


==Macro reference==


{| 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;" | '''ChangeI2CAddress'''
|-
| colspan="2" | Allows the I2C Device address to be changed which in turn allows more then one RFID reader to sit on the same physical I2C bus. Returns 1 if succesful.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NewAddress
|-
| colspan="2" | Range: 8 to 119 or 0x08 - 0x77&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
''<span style="color:red;">No additional examples</span>''
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckButton'''
|-
| colspan="2" | Checks to see if the button has been pressed since the last read of CheckButton or ReadButton.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| 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;" | '''ReadAxis'''
|-
| colspan="2" | Reads a single axis of the joystick and returns as a signed integer value.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Axis
|-
| colspan="2" | Range 0-1 Where 0=X, 1=Y&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Type
|-
| colspan="2" | 0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023)&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| 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;" | '''SimMoveThumbStick'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | X
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Y
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Component
|-
| colspan="2" | &nbsp;
|-
| 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''
|}




{| 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;" | '''ReadButton'''
|-
| colspan="2" | Checks to see if the button is currently pressed&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| 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 bus ready for communications with the module.&nbsp;
|-
|-
| 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''
|}








==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
==Macro reference==
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Return To Center
|-
| 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.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Limits
|-
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | X Min
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | X Max
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Device Address
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Theme
|-
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Box Colour
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Shaft Colour
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Knob Colour
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Style
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-12-icon.png]]
| width="90%" | Style
|-
| colspan="2" | Outline line style&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | Channel selection&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Baud Select
|-
| colspan="2" | Baud rate option selector&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | SDA
|-
| colspan="2" | Pin used for SDA (data signal)&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | SDA Remap Pin
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | SCL
|-
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | SCL Remap Pin
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Stop Delay
|-
| colspan="2" | 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. &nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Simulate Comms
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Scope Traces
|-
| colspan="2" | 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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Console Data
|-
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | API
|-
| colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation.&nbsp;
|}==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ChangeI2CAddress===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangeI2CAddress'''
| width="90%" class="mtx-class-macrohead" | '''ChangeI2CAddress'''
|-
|-
| colspan="2" | Allows the I2C Device address to be changed which in turn allows more then one RFID reader to sit on the same physical I2C bus. Returns 1 if succesful.&nbsp;
| colspan="2" | Allows the I2C Device address to be changed which in turn allows more then one RFID reader to sit on the same physical I2C bus. Returns 1 if succesful.&nbsp;
Line 296: Line 82:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CheckButton===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckButton'''
| width="90%" class="mtx-class-macrohead" | '''CheckButton'''
|-
|-
| colspan="2" | Checks to see if the button has been pressed since the last read of CheckButton or ReadButton.&nbsp;
| colspan="2" | Checks to see if the button has been pressed since the last read of CheckButton or ReadButton.&nbsp;
Line 309: Line 96:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAxis'''
|-
| colspan="2" | Reads a single axis of the joystick and returns as a signed integer value.&nbsp;
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" | Axis
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| colspan="2" | Range 0-1 Where 0=X, 1=Y&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Type
|-
| colspan="2" | 0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023)&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| 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;" | '''SimMoveThumbStick'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | X
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Y
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" | Component
|-
| colspan="2" | &nbsp;
|-
| 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''
|}
 
 
{| 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;" | '''ReadButton'''
|-
| colspan="2" | Checks to see if the button is currently pressed&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| 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 bus ready for communications with the module.&nbsp;
| colspan="2" | Initialises the I2C bus ready for communications with the module.&nbsp;
Line 386: Line 110:




 
===ReadAxis===
 
{| class="mtx-class-macrotable wikitable"
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''ReadAxis'''
|-
|-
| colspan="2" | Reads a single axis of the joystick and returns as a signed integer value.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Return To Center
|-
|-
| 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.&nbsp;
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Axis
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| colspan="2" | Range 0-1 Where 0=X, 1=Y&nbsp;
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Limits
|-
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Type
|-
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| colspan="2" | 0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023)&nbsp;
| width="90%" | X Min
|-
|-
| colspan="2" | &nbsp;
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | X Max
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Device Address
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Theme
|-
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Box Colour
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Shaft Colour
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Knob Colour
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Style
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-12-icon.png]]
| width="90%" | Style
|-
| colspan="2" | Outline line style&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | Channel selection&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Baud Select
|-
| colspan="2" | Baud rate option selector&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | SDA
|-
| colspan="2" | Pin used for SDA (data signal)&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | SDA Remap Pin
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | SCL
|-
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | SCL Remap Pin
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Stop Delay
|-
| colspan="2" | 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. &nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Simulate Comms
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Scope Traces
|-
| colspan="2" | 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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Console Data
|-
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | API
|-
| colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation.&nbsp;
|}==Macro reference==
 
{| 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;" | '''ChangeI2CAddress'''
|-
| colspan="2" | Allows the I2C Device address to be changed which in turn allows more then one RFID reader to sit on the same physical I2C bus. Returns 1 if succesful.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NewAddress
|-
| colspan="2" | Range: 8 to 119 or 0x08 - 0x77&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadButton===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckButton'''
| width="90%" class="mtx-class-macrohead" | '''ReadButton'''
|-
|-
| colspan="2" | Checks to see if the button has been pressed since the last read of CheckButton or ReadButton.&nbsp;
| colspan="2" | Checks to see if the button is currently pressed&nbsp;
|-
|-
|-
|-
Line 544: Line 148:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SimMoveThumbStick===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAxis'''
|-
| colspan="2" | Reads a single axis of the joystick and returns as a signed integer value.&nbsp;
|-
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" class="mtx-class-macrohead" | '''SimMoveThumbStick'''
| width="90%" | Axis
|-
| colspan="2" | Range 0-1 Where 0=X, 1=Y&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Type
|-
| colspan="2" | 0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023)&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| 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;" | '''SimMoveThumbStick'''
|-
|-
| colspan="2" | &nbsp;
| colspan="2" | &nbsp;
Line 593: Line 175:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| 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;" | '''ReadButton'''
|-
| colspan="2" | Checks to see if the button is currently pressed&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| 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 bus ready for communications with the module.&nbsp;
|-
|-
| 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''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 636: Line 190:
| 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.&nbsp;
| 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.&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Limits
| width="90%" class="mtx-class-propfolder" | Limits
|-
|-
|-
|-
Line 655: Line 209:
| colspan="2" | &nbsp;
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Theme
| width="90%" class="mtx-class-propfolder" | Theme
|-
|-
|-
|-
Line 684: Line 238:
| colspan="2" | Outline line style&nbsp;
| colspan="2" | Outline line style&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
Line 723: Line 277:
| colspan="2" | 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. &nbsp;
| colspan="2" | 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. &nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-
Line 747: Line 301:
| colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation.&nbsp;
| colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation.&nbsp;
|}
|}
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.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_2dgi.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx]

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 10.0
Category Analog Input


Joystick (Sparkfun Quiic) 2D component

An XY sprung joystick with click switch allowing for easy user input control. Connected using I2C bus.

Version information

Library Version, Component Version, Date, Author, Info
10, 10.0, 04-12-24, MW,Icon edited so compatible with dark theme 


Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

ChangeI2CAddress

ChangeI2CAddress
Allows the I2C Device address to be changed which in turn allows more then one RFID reader to sit on the same physical I2C bus. Returns 1 if succesful. 
- BYTE NewAddress
Range: 8 to 119 or 0x08 - 0x77 
- BOOL Return


CheckButton

CheckButton
Checks to see if the button has been pressed since the last read of CheckButton or ReadButton. 
- BOOL Return


Initialise

Initialise
Initialises the I2C bus ready for communications with the module. 
- VOID Return


ReadAxis

ReadAxis
Reads a single axis of the joystick and returns as a signed integer value. 
- BYTE Axis
Range 0-1 Where 0=X, 1=Y 
- BOOL Type
0 = Signed (-512 to 511), 1 = Unsigned (0 to 1023) 
- INT Return


ReadButton

ReadButton
Checks to see if the button is currently pressed 
- BOOL Return


SimMoveThumbStick

SimMoveThumbStick
 
- FLOAT X
 
- FLOAT Y
 
- HANDLE Component
 
- VOID Return


Property reference

Properties
Return To Center
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. 
Limits
X Min
 
X Max
 
Device Address
 
Theme
Box Colour
 
Shaft Colour
 
Knob Colour
 
Style
 
Style
Outline line style 
Connections
Channel
Channel selection 
Baud Select
Baud rate option selector 
SDA
Pin used for SDA (data signal) 
SDA Remap Pin
 
SCL
Pin used for SCL (clock signal) 
SCL Remap Pin
 
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.  
Simulation
Simulate Comms
 
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. 
Console Data
Selects if the console data is automatically generated or not 
API
Specifies the API component on the panel to interact with to provide comms simulation. 

Component Source Code

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

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