Difference between revisions of "Component: Keypad (EB014) (E-blocks 1)"

From Flowcode Help
Jump to navigationJump to search
(XML import - Pre 8.0 release)
 
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| E-blocks 1
 
| E-blocks 1
 
|}
 
|}
  
  
 
+
==Keypad component==
==[[File:Component Icon e871d984_b0e0_4185_8d94_b11d28040996.png|Image]] Keypad (EB014) component==
 
 
Preset keypad based around the 3 * 4 unit, as used by the Matrix EB014 E-block
 
Preset keypad based around the 3 * 4 unit, as used by the Matrix EB014 E-block
  
==Examples==
+
==Component Source Code==
''<span style="color:red;">No additional examples</span>''
 
  
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Keypad_EB014.fcfx FC_Comp_Source_Keypad_EB014.fcfx]
  
==Downloadable macro reference==
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Keypad_EB014.fcfx FC_Comp_Source_Keypad_EB014.fcfx]
  
===<span style="font-weight: normal;"><u><tt>WaitPressed</tt></u></span>===
+
==Detailed description==
Blocking call that waits for one of the keys on the keypad to be pressed. The index of the key that was pressed  is passed back to the user.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]] : Index of the first key pressed.
 
  
  
===<span style="font-weight: normal;"><u><tt>GetAscii</tt></u></span>===
 
Gets the ASCII value for the current keypress. If no key is pressed then the macro returns the value 255.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
+
''No detailed description exists yet for this component''
  
:[[Variable Types|BYTE]] : ASCII code of the pressed switch (or 255 if none pressed)
+
==Examples==
  
  
===<span style="font-weight: normal;"><u><tt>GetString</tt></u></span>===
 
Gets the ASCII value for the current keypress and returns in the form of a string. If no key pressed then the macro returns the value 255.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|STRING]] : Single character representing the pressed key, or an empty string if none pressed.
 
  
  
===<span style="font-weight: normal;"><u><tt>GetNumber</tt></u></span>===
 
Gets the numeric value for the current keypress. If no key pressed then the macro returns the value 255.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]] : Number return value of the pressed key, or 255 if none pressed.
 
  
  
===<span style="font-weight: normal;"><u><tt>GetIndex</tt></u></span>===
 
Gets the index value for the current keypress. If no key pressed then the macro returns the value 255.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
 +
===Basic Example===
  
'''Return value'''
+
Keypad Example File demonstrating controlling a door lock.
  
:[[Variable Types|BYTE]] : Index of the pressed switch, or 255 if none pressed.
+
LED is used to show the pin status controlling the door lock.
  
 +
{{Fcfile|Keypad Door Entry.fcfx|Keypad Door Entry}}
  
===<span style="font-weight: normal;"><u><tt>WaitReleased</tt></u></span>===
+
==Macro reference==
Blocking call that waits for the keys on the keypad to be released. If no key is pressed then the function will return immediatley.
 
  
'''Parameters'''
+
===GetAscii===
 +
{| 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;" | '''GetAscii'''
 +
|-
 +
| colspan="2" | Gets the ASCII value for the current keypress. If no key is pressed then the macro returns the value 255.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This macro has no parameters''
 
  
 +
===GetIndex===
 +
{| 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;" | '''GetIndex'''
 +
|-
 +
| colspan="2" | Gets the index value for the current keypress. If no key pressed then the macro returns the value 255.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
+
===GetNumber===
 +
{| 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;" | '''GetNumber'''
 +
|-
 +
| colspan="2" | Gets the numeric value for the current keypress. If no key pressed then the macro returns the value 255.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 +
===GetString===
 +
{| 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;" | '''GetString'''
 +
|-
 +
| colspan="2" | Gets the ASCII value for the current keypress and returns in the form of a string. If no key pressed then the macro returns the value 255.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
+
===WaitPressed===
 +
{| 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;" | '''WaitPressed'''
 +
|-
 +
| colspan="2" | Blocking call that waits for one of the keys on the keypad to be pressed. The index of the key that was pressed  is passed back to the user.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
==Property reference==
+
===WaitReleased===
<span style="font-weight: normal;"><u>Port</u></span>
+
{| 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;" | '''WaitReleased'''
 +
|-
 +
| colspan="2" | Blocking call that waits for the keys on the keypad to be released. If no key is pressed then the function will return immediatley.&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''
 +
|}
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''port''.
 
  
From here, set the port to which your EB014 is connected.
+
==Property reference==
  
If you are wiring your own hardware, you can use the 'Custom Pins' setting to allow the
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
selection of individual pins for each row or column.
+
| 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" 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%" | Port
 +
|-
 +
| colspan="2" | From here, set the port to which your EB014 is connected. If you are wiring your own hardware, you can use the 'Custom Pins' setting to allow the selection of individual pins for each row or column.&nbsp;
 +
|}

Latest revision as of 10:12, 24 July 2024

Author Matrix TSL
Version 1.0
Category E-blocks 1


Keypad component

Preset keypad based around the 3 * 4 unit, as used by the Matrix EB014 E-block

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

Basic Example

Keypad Example File demonstrating controlling a door lock.

LED is used to show the pin status controlling the door lock.

FC6 Icon.png Keypad Door Entry

Macro reference

GetAscii

Fc9-comp-macro.png GetAscii
Gets the ASCII value for the current keypress. If no key is pressed then the macro returns the value 255. 
Fc9-u8-icon.png - BYTE Return


GetIndex

Fc9-comp-macro.png GetIndex
Gets the index value for the current keypress. If no key pressed then the macro returns the value 255. 
Fc9-u8-icon.png - BYTE Return


GetNumber

Fc9-comp-macro.png GetNumber
Gets the numeric value for the current keypress. If no key pressed then the macro returns the value 255. 
Fc9-u8-icon.png - BYTE Return


GetString

Fc9-comp-macro.png GetString
Gets the ASCII value for the current keypress and returns in the form of a string. If no key pressed then the macro returns the value 255. 
Fc9-string-icon.png - STRING Return


WaitPressed

Fc9-comp-macro.png WaitPressed
Blocking call that waits for one of the keys on the keypad to be pressed. The index of the key that was pressed is passed back to the user. 
Fc9-u8-icon.png - BYTE Return


WaitReleased

Fc9-comp-macro.png WaitReleased
Blocking call that waits for the keys on the keypad to be released. If no key is pressed then the function will return immediatley. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Port
From here, set the port to which your EB014 is connected. If you are wiring your own hardware, you can use the 'Custom Pins' setting to allow the selection of individual pins for each row or column.