Question
Key de-bouncing in 4x4 matrix Keypad. I need the output to the 2 7-segment LED. It will show last two number. For example if I
Key de-bouncing in 4x4 matrix Keypad. I need the output to the 2 7-segment LED. It will show last two number. For example if I press 5, it shows 5 on the right. If I keep press 5 again, it will show 5 on the left, 5 on the right. If I press 8, it will show 5 on the left, 8 on the right.
Please add key de-bouncing to my code to make it work.
void read(void) { char left_val = 'n'; char right_val = 'n'; char next_val = readKeyPad();
while(1){ next_val = readKeyPad(); if (right_val == next_val || next_val == 'n'){ printChar(left_val, Left); delay(FRAME_PERIOD); printChar(right_val, Right); delay(FRAME_PERIOD); } else { left_val = right_val; right_val = next_val; } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started