Jump to content

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

From Flowcode Help
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(16 intermediate revisions by 3 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==


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]


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]


==Detailed description==








===Basic Example===


Keypad Example File demonstrating controlling a door lock.


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


{{Fcfile|Keypad Door Entry.fcfx.fcfx|Keypad Door Entry}}


==Downloadable macro reference==


===<span style="font-weight: normal;"><u><tt>WaitPressed</tt></u></span>===
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''
''No detailed description exists yet for this component''


==Examples==


'''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'''


:[[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'''
===Basic Example===


:''This macro has no parameters''
Keypad Example File demonstrating controlling a door lock.


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


'''Return value'''
{{Fcfile|Keypad Door Entry.fcfx|Keypad Door Entry}}


:[[Variable Types|BYTE]] : Number return value of the pressed key, or 255 if none pressed.
==Macro reference==


===GetAscii===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


===<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'''
===GetIndex===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''


===GetNumber===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


'''Return value'''


:[[Variable Types|BYTE]] : Index of the pressed switch, or 255 if none pressed.
===GetString===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}




===<span style="font-weight: normal;"><u><tt>WaitReleased</tt></u></span>===
===WaitPressed===
Blocking call that waits for the keys on the keypad to be released. If no key is pressed then the function will return immediatley.
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
===WaitReleased===
 
{| class="mtx-class-macrotable wikitable"
 
|-
'''Return value'''
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
 
| width="90%" class="mtx-class-macrohead" | '''WaitReleased'''
:''This call does not return a value''
|-
 
| 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;
 
|-
 
|-
==Simulation macro reference==
| 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 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="mtx-class-macrotable wikitable"
 
|-
From here, set the port to which your EB014 is connected.
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
 
| width="90%" class="mtx-class-macrohead" | '''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" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | 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 14:37, 13 July 2026

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.

Keypad Door Entry

Macro reference

GetAscii

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


GetIndex

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


GetNumber

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


GetString

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. 
- STRING Return


WaitPressed

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. 
- BYTE Return


WaitReleased

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. 
- VOID Return


Property reference

Properties
Connections
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.