Difference between revisions of "Component: Joystick (Sparkfun Quiic) (Analog Input)"

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick_2dgi.fcfx]
+
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 34: Line 36:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 102: Line 106:
 
|-
 
|-
 
| 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-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" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | X
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Y
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | Component
 
|-
 
| colspan="2" |  
 
|-
 
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 174: Line 150:
 
|-
 
|-
 
| 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" 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" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | X Max
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| 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="90%" style="background-color:#EAE1EA; color:#4B008D;" | Theme
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Box Colour
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Shaft Colour
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Knob Colour
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Style
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-12-icon.png]]
 
| width="90%" | Style
 
|-
 
| colspan="2" | Outline line style 
 
 
|-
 
|-
 
| 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 236: Line 169:
 
|-
 
|-
 
| 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 241: Line 179:
 
|-
 
|-
 
| colspan="2" | Pin used for SDA (data signal) 
 
| colspan="2" | Pin used for SDA (data signal) 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | SDA Remap Pin
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Line 251: Line 184:
 
|-
 
|-
 
| colspan="2" | Pin used for SCL (clock signal) 
 
| colspan="2" | Pin used for SCL (clock signal) 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | SCL Remap Pin
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Line 269: Line 197:
 
| 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 284: Line 212:
 
| width="90%" | API
 
| width="90%" | API
 
|-
 
|-
| colspan="2" | Specifies the API component on the panel to interact with to provide comms simulation. 
+
| colspan="2" | Specifies the injector component on the panel to interact with to provide comms simulation. 
 
|}
 
|}

Revision as of 17:51, 9 November 2022

Author Matrix TSL
Version 1.0
Category Analog Input


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 for the component source code: FC_Comp_Source_Sparkfun_Quiic_Joystick.fcfx

Detailed description

No detailed description exists yet for this component

Examples

There is a detailed walk through of the scenario detailed at the link below to go with this component.

Traffic Light Scenario

Downloadable macro reference

Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE NewAddress
Range: 8 to 119 or 0x08 - 0x77 
Fc9-bool-icon.png - BOOL Return


Fc9-comp-macro.png CheckButton
Checks to see if the button has been pressed since the last read of CheckButton or ReadButton. 
Fc9-bool-icon.png - BOOL Return


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


Fc9-comp-macro.png ReadButton
Checks to see if the button is currently pressed 
Fc9-bool-icon.png - BOOL Return


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



Property reference

Fc9-prop-icon.png Properties
Fc9-type-7-icon.png 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. 
Fc9-type-21-icon.png Device Address
External device address used to communicate with the module. Default 32 or 0x20 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
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-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms
Controls if we are using the panel simulation or simulating the I2C calls for use with an I2C injector. 
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
Specifies the injector component on the panel to interact with to provide comms simulation.