Difference between revisions of "Component: Keypad (Generic) (Keypad)"
Line 20: | Line 20: | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 28: | Line 30: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 58: | Line 62: | ||
[[File:KeypadCirBuff.jpg]] | [[File:KeypadCirBuff.jpg]] | ||
− | == | + | ==Macro reference== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 14:12, 20 January 2023
Author | Matrix Ltd |
Version | 1.5 |
Category | Keypad |
Contents
Keypad (Generic) component
Generic component to create a raster scanned custom keypad or button matrix. By default, each key is labelled with its ASCII return character. Alternatively, each key may use an image as a label. To use a custom key shape, build a single key, then point to it with the 'Custom key shape" property. If the custom shape is a group, any item within the group that has a handle beginning with "label" will have the key label/image applied to it automatically.
Component Source Code
Please click here for the component source code: FC_Comp_Source_Keypad_Base.fcfx
Detailed description
No detailed description exists yet for this component
Examples
3 x 4 Keypad Schematic
Example schematic of a 3 x 4 Keypad.
Multi Digit Number Entry
A simple example to take in a decimal number (0-65535) from the user and then use this number as a delay for flashing a LED on and off. Shows the principals of reading the keypad and building up a multi-digit number.
Keypad Based Door Entry System
Each key press on the keypad is fed into the Circular Buffer component. We then poll the buffer to see if the correct characters for the password have been entered.
If the correct sequence is detected then we activate the solenoid component for 5 seconds.
Macro reference
![]() |
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. | |
![]() |
Return |
![]() |
GetAscii |
Gets the ASCII value for the current keypress. If no key is pressed then the macro returns the value 255. | |
![]() |
Return |
![]() |
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 a null string. | |
![]() |
Return |
![]() |
GetNumber |
Gets the numeric value for the current keypress. If no key pressed then the macro returns the value 255. | |
![]() |
Return |
![]() |
GetIndex |
Gets the index value for the current keypress. If no key pressed then the macro returns the value 255. | |
![]() |
Return |
![]() |
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. | |
![]() |
Return |