In the previous article we saw how we could implement a simple calculator using Delphi. This time we connect an external keypad to the serial port, to allow the calculator to be controlled externally. We'll use the program from the last article (slightly modified) to put the numbers onto the display and to perform the calculations.
The external keypad, which we'll build ourselves, consists of 16 keys in a configuration of 4 rows by 4 columns. When a key is pressed, a single row is connected to a single column. The combination of the exact row and column is unique for each key.
By activating each column in turn and then checking which row has a signal, we can determine which key has been pressed.
Discussion (0 comments)