This is a simple project that shows you how to control a 7 Segment Display with a Numeric Keypad! Whatever number you press on the keypad will appear on the Seven Segment Display!
Making ItThe schematic is down below. It should be pretty easy. You need to use a 3x4 matrix keypad so you have enough pins.
The CodeIn my sketch, to easily control the 7 Segment Display, I am using the sevenSegmentDisplay library by Giuseppe Masino which you will need to install also. You can download it from the Arduino Library Manager or the Github page. You will also need to install the Keypad library which you can also get from the Arduino Library manger.
You will need to tweak the code a little bit to get it to work. Here's what you need to do:
At this line:
sevenSegmentDisplay ssd(COMMON_ANODE, 13, 12, 11, 10, 9, 8, 7, A0);
If you have a common cathode display change COMMON_ANODE to COMMON_CATHODE. Also, you may have noticed that I put A0 for the decimal point. We're not using the DP in this project, so it doesn't really matter.
That's it, upload the code and you should be ready to go!
Keypad image by Adafruit
Comments