Music Keypad – Schematic

First, we had to find a way to implement the keypad properly. After searching for the schematic on the internet, we realized that one pin was connected to all four buttons. The schematic is below. To understand the functionality of the keypad, we began the code by only using the first button. We connected one of the pins attached to all buttons to VCC on the J2 header. The other pin connected to button one is connected to ADC2 pin of the J2 header as well. We decided on using the J2 header because they are ADC/DAC pins on the microcontroller. Also, the J2 header pins were defined in the code as COL1, COL2, COL3, and COL4 for the column of each button. The code stated that the light on the microcontroller, LED0, will turn on when button one is pushed via an if statement. We also added a string of code to display on the LCD screen to show what button was pressed. At first, the LCD screen seemed to act a bit intermittent, and after speaking with the professor, a 10k resistor was added to eliminate floating values. By adding the resistor, we were able to have button one work successfully.  We started to implement button two.  After a bit of troubleshooting we were able to get button two working successfully, and from there it was just a matter of duplicating the code.

General schematic for our project
Wiring for the 4-input keypad
Schematic for 4 input keypad