Testing and Programming
The best way to program this project is in three pieces:
- Test the 4×4 matrix keypad alone using the example Blockly code.
- Test the 7-segment display alone using the example Blockly code.
- If both of the above were successful, program the entire project!
- Download the 4×4 Matrix Keypad Test code below, then open and run it with BlocklyProp Solo.
Project8624-4×4-Matrix-Keypad-Test.svg
- To make sure every part is working separately before synthesizing all of it, run the main loop with the keyNumber variable. This will ensure that the 4×4 matrix keypad is wired correctly and working as intended. Below is an example of what the terminal should display – in this case the number 9 is being pressed.
Next, test the seven-segment display by loading the Blockly code for the Seven-Segment Display Test:
Project8621-Seven-Segment-Test.svg
This will cycle through numbers 0-9 in an endless loop.
If the 4×4 matrix keypad and seven-segment display codes worked successfully, then you’re ready to run the Blockly code for the 4×4 Matrix Keypad with Seven-Segment Display (shown in full below):
Project8331-4×4-Keypad-7-Seg-Display.svg