Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following code and keypad layout, give the hexadecimal value that GetKey () will return when it is run while keys 6, 8, A,
Given the following code and keypad layout, give the hexadecimal value that GetKey () will return when it is run while keys 6, 8, A, and E are pressed row0 PORT (O] PORT1] PORT2] row 3 PORT (3] 10 K Read ke column 0 PORT 4] Voc 10 K Read column 1 PORT 5 Vcc 10 K Read ke column 2 PORT(6] Vce 10 K column 3 PORT 7) TRI SB & 0x0000000F; TRISB ! 0x000000F0 ; LATB 0x0000000F; unsigned char GetKey (void) unsigned char RowMask [4] {0x0E, 0x0D, 0x0B, 0x07); char row unsigned char input unsigned int KeyMask = 0; for (row=0; rowROWS ; row++) LATB = RowMask [row] ; input = (PORTB & 0xF0) >> 4; KeyMask l= input > 4; KeyMask l= input
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