For Propeller Activity Board WX, FLiP and Other board types. Not available for Badge or Scribbler Robot board types.
These blocks are specifically for the 4 x 4 Matrix Membrane Keypad (#27899) [1] sold by Parallax.
New to this sensor? Click here to see an example schematic and quick Blockly program [2] to help you get started.
The 4x4 Keypad Initialize block defines the connections between the Keypad's ribbon cable and the Propeller microcontroller's I/O pins. I/O pin availability will vary by board type.
If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:
If you forget to use this block in your program, a triangle warning icon will appear on other 4 x 4 keypad blocks as a reminder.
With the keypad facing you, start matching from the leftmost pin to the rightmost pin. The four rightmost pins MUST be connected to pull-down resistors; use 1 k-ohm to 100 k-ohm resistors for this.
The 4x4 Keypad read block provides a number value for the key pressed.
This example is specifically for the 4 x 4 Matrix Membrane Keypad (#27899) [1] sold by Parallax.
Using the connections shown in the wiring diagram above, this program will show you the number of the key you are pressing on the keypad, in the Terminal, updating once per half-second.
The numbers you see should be very stable. If they fluctuate quickly, or if you notice numbers showing up that you did not press, double-check that you have 1 kOhm (or higher) resistors from pins P7-P4 going to ground and that they're firmly in the correct breadboard row and ground holes. See connection image, above.
Links
[1] http://www.parallax.com/product/27899
[2] https://learn.parallax.com/support/reference/propeller-blocklyprop-block-reference/sensor/4-x-4-keypad/4x4-keypad-wiring