Component: Keypad (Generic) (Keypad)

From Flowcode Help
Revision as of 16:20, 7 January 2022 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.5 |- | width="20%" style="color:gray...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Author Matrix Ltd
Version 1.5
Category Keypad


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 Pack

FREE

Detailed description

No detailed description exists yet for this component

Examples

3 x 4 Keypad Schematic

Example schematic of a 3 x 4 Keypad.

KeypadSchematic2.jpg


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.

FC6 Icon.png Keypad Delay


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.

FC6 Icon.png Keypad Door Entry

If the correct sequence is detected then we activate the solenoid component for 5 seconds.

KeypadCirBuff.jpg

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 a null string. 
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-type-14-icon.png Columns
Number of columns (left to right) in the array of keys. Must be a value from one to four. 
Fc9-type-15-icon.png Column spacing
Distance between columns in current world units. 
Fc9-type-14-icon.png Rows
Number of rows (top to bottom) in the key matrix. Must be a value from one to four. 
Fc9-type-15-icon.png Row spacing
Distance between rows in current world units. 
Fc9-type-16-icon.png First row
Decide whether rows are counted from the top to the bottom (default), or from the bottom to the top.  
Fc9-type-15-icon.png Key movement
The distance that the keys move into the panel when pressed. 
Fc9-type-10-icon.png ASCII
A list of return values for the 'GetString' and 'GetASCII' macros. Enter a string with one character per key, in order of key scanning. Columns are counted first (left-to-right), then rows (direction set by the 'First Row' property) e.g. for a 2*2 grid, the order would be... [Row0, Column0], [Row0,Column1], ][Row1, Column0], [Row1, Column1] 
Fc9-type-11-icon.png Numbers
A list of return values for the 'GetNumber' macro. Enter a comma separated list with one integer value per key, in order of key scanning. Columns are counted first (left-to-right), then rows (direction set by the 'First Row' property) e.g. for a 2*2 grid, the order would be... [Row0, Column0], [Row0,Column1], ][Row1, Column0], [Row1, Column1] 
Fc9-type-17-icon.png Custom key shape
To use a custom shape for the keys... 1 - On the System Panel, use shapes and/or meshes to design a new key shape. The top surface of the key, where your finger would press, must be uppermost in the Z-axis. 2 - If your key requires a label, include an iobject suitable for drawing a lable onto, and give it a handle name beginning with the word 'label'. 3 - The new key design can be made up of many individual objects - make sure to select them all and group them toegether into a single item. 4 - Now set the 'Cusrtom' property to point at your new design. The original 'prototype' will be hidden, and duplicated into the keypad matrix as many times as required. If there is a 'label' object inside the key design, each key's 'ASCII' return value will be printed there. 5 - Use the 'Button' properties below to set colours, and optional bitmap labels, for individual keys. 
Fc9-type-3-icon.png Label font
Set the font here to use for printing the 'ASCII' labels to the inidividual key-caps. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label Color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-2-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-2-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-type-1-icon.png Key color
Set the color of the key body here. This is applied to all objects making up a key, including the background color of any text labels. 
Fc9-type-1-icon.png Label color
Set the color for the default 'ASCII' text label on the key-cap. This setting will be ignored if a bitmap is set for the key label. 
Fc9-type-13-icon.png Image
Choose a bitmap file (.bmp, .jpg, .png) to use instead of the default 'ASCII' key legend. The bitmap will be drawn onto any object within the key component with a handle that begins with the word 'label'. 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Column 1
Pin for the first column of keys. Columns are counted from left to right. 
Fc9-type-5-icon.png Column 2
Pin for the second column of keys. Columns are counted from left to right. 
Fc9-type-5-icon.png Column 3
Pin for the third column of keys. Columns are counted from left to right. 
Fc9-type-5-icon.png Row 1
Pin for the first row of keys. Columns are counted from top to bottom by default - they can be counted from bottom to top by changing the 'First Row' property in the 'Dimensions' section. 
Fc9-type-5-icon.png Row 2
Pin for the second row of keys. Columns are counted from top to bottom by default - they can be counted from bottom to top by changing the 'First Row' property in the 'Dimensions' section. 
Fc9-type-5-icon.png Row 3
Pin for the third row of keys. Columns are counted from top to bottom by default - they can be counted from bottom to top by changing the 'First Row' property in the 'Dimensions' section. 
Fc9-type-5-icon.png Row 4
Pin for the fourth row of keys. Columns are counted from top to bottom by default - they can be counted from bottom to top by changing the 'First Row' property in the 'Dimensions' section. 
Fc9-conn-icon.png Simulations