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

From Flowcode Help
Jump to navigationJump to search
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==
 +
Preset keypad based around the 3 * 4 unit, as used by the Matrix EB014 E-block
 +
 +
==Component Source Code==
 +
 +
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Keypad_EB014.fcfx FC_Comp_Source_Keypad_EB014.fcfx]
  
==[[File:Component Icon e871d984_b0e0_4185_8d94_b11d28040996.png|Image]] Keypad (EB014) component==
+
==Detailed description==
Preset keypad based around the 3 * 4 unit, as used by the Matrix EB014 E-block
+
 
 +
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 36: Line 43:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>WaitPressed</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
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.
+
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| 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''
 +
|}
  
  
'''Return value'''
+
{| 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''
 +
|}
  
:[[Variable Types|BYTE]] : Index of the first key pressed.
 
  
 +
{| 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''
 +
|}
  
===<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'''
+
{| 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''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| 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''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]] : ASCII code of the pressed switch (or 255 if none pressed)
 
 
 
===<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''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]] : Index of the pressed switch, or 255 if none pressed.
 
 
 
===<span style="font-weight: normal;"><u><tt>WaitReleased</tt></u></span>===
 
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'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Port</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''port''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
From here, set the port to which your EB014 is connected.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
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.
+
| 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;
 +
|}

Revision as of 14:41, 16 January 2023

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

Downloadable macro reference

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


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


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


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


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


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.