Testing and Programming

The best way to program this project is in three pieces:

  1. Test the 4x4 matrix keypad alone using the example Blockly code.
  2. Test the 7-segment display alone using the example Blockly code.
  3. If both of the above were successful, program the entire project!  
  • Download the 4x4 Matrix Keypad Test code below, then open and run it with BlocklyProp Solo.

Project8624-4x4-Matrix-Keypad-Test.svg

Test code for the 4x4 Keypad in BlocklyProp.

  • 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 4x4 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.

Terminal display for the 4x4 Keypad test code shown above.

Next, test the seven-segment display by loading the Blockly code for the Seven-Segment Display Test:

Project8621-Seven-Segment-Test.svg

 

7-segment LED test code for BlocklyProp.

This will cycle through numbers 0-9 in an endless loop.

If the 4x4 matrix keypad and seven-segment display codes worked successfully, then you’re ready to run the Blockly code for the 4x4 Matrix Keypad with Seven-Segment Display (shown in full below):

Project8331-4x4-Keypad-7-Seg-Display.svg

Part 1 of the full code for the 4x4 Keypad and 7-segment LED project.

Part 2 of the full code for the 4x4 Keypad and 7-segment LED project.