Difference between revisions of "Joystick (use with mDesigner)"

From Microduino Wiki
Jump to: navigation, search
(Joystick - Check Direction State)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This Joystick is an input sensor which can detect the direction in which the stick is positioned. Support for this trinket is found in mDesigner.
+
The Joystick is an input sensor which can detect the direction in which the stick is positioned. Support for this trinket is found in mDesigner.
  
 
=Compatible Pins=
 
=Compatible Pins=
Line 102: Line 102:
 
=Blocks=
 
=Blocks=
 
==Joystick - Check Direction State==
 
==Joystick - Check Direction State==
 +
 +
This block checks the Joystick's position (key) and that position's state.<br>If the block's configured state matches the actual physical Joystick's state, then '''true''' is returned. Otherwise, '''false''' is returned.<br>
 +
[[File:MDesigner_Joystick_Block.png]]
 
[[File:Joystick_Directions.png|thumb|200px|right]]
 
[[File:Joystick_Directions.png|thumb|200px|right]]
 
[[File:Joystick_Center.png|thumb|175px|right]]
 
[[File:Joystick_Center.png|thumb|175px|right]]
This block checks the Joystick's position (key) and that position's state.<br>If the block's configured state matches the actual physical Joystick's state, then '''true''' is returned. Otherwise, '''false''' is returned.<br>
+
*'''Pin Number''' - the pin that the Joystick is connected to.
[[File:MDesigner_Joystick_Block.png]]
+
*'''Key''' - the position of interest.
**'''Pin Number''' - the pin that the Joystick is connected to.
+
**'''Up'''
**'''Key''' - the position of interest.
+
**'''Down'''
***'''Up'''
+
**'''Left'''
***'''Down'''
+
**'''Right'''
***'''Left'''
+
**'''Center''' - pressing directly on Joystick.
***'''Right'''
+
*'''State''' - the state to check for:
***'''Center''' - pressing directly on Joystick.
+
**'''Released''' - the position of interest is not pressed.
**'''State''' - the state to check for:
+
**'''Pressed''' - the position of interest has been "pressed at some point".  
***'''Released''' - the position of interest is not pressed.
+
***The "press at some point" is reset once this check is performed. The position of interest must be pressed again in order to register "press at some point" again.
***'''Pressed''' - the position of interest has been "pressed at some point".  
+
**'''Pressing''' - the position of interest is '''CURRENTLY''' being pressed at the time of this check.
****The "press at some point" is reset once this check is performed. The position of interest must be pressed again in order to register "press at some point" again.
 
***'''Pressing''' - the position of interest is '''CURRENTLY''' being pressed at the time of this check.
 
 
===Examples===
 
===Examples===

Latest revision as of 14:52, 13 June 2018

The Joystick is an input sensor which can detect the direction in which the stick is positioned. Support for this trinket is found in mDesigner.

Compatible Pins

The following pins on the Hub or mCenter+'s Hub support this module:

Hub AnalogRead Pins.png
Pin Name Compatibility Notes
Pin 0 No
Pin 1 No
Pin 2 No
Pin 3 No
Pin 4 No
Pin 5 No
Pin 6 No
Pin 7 No
Pin 8 No
Pin 9 No
Pin 10 No
Pin 11 No
Pin 12 No
Pin 13 No
Pin A0 Yes
Pin A1 Yes
Pin A2 Yes
Pin A3 Yes
Pin A6 Yes
Pin A7 Yes
Pin I2C No


Blocks

Joystick - Check Direction State

This block checks the Joystick's position (key) and that position's state.
If the block's configured state matches the actual physical Joystick's state, then true is returned. Otherwise, false is returned.
MDesigner Joystick Block.png

Joystick Directions.png
Joystick Center.png
  • Pin Number - the pin that the Joystick is connected to.
  • Key - the position of interest.
    • Up
    • Down
    • Left
    • Right
    • Center - pressing directly on Joystick.
  • State - the state to check for:
    • Released - the position of interest is not pressed.
    • Pressed - the position of interest has been "pressed at some point".
      • The "press at some point" is reset once this check is performed. The position of interest must be pressed again in order to register "press at some point" again.
    • Pressing - the position of interest is CURRENTLY being pressed at the time of this check.

Examples