Question: Given the following code and keypad layout, give the hexadecimal value that GetKey() will return when it is run while keys 0, 4, 5, and
Given the following code and keypad layout, give the hexadecimal value thatGetKey() will return when it is run while keys 0, 4, 5, and 8 are pressed.
TRISB &= 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; row
0 Assert PORT keypad row o o PORTkeypad row11 PORT2 keypad row2 2 4 Assert Assert Assert keypad row 3 3 PORTx 3] Vcc 4 10 K Read kevpad column 0 PORTx 4] Vcc 10 K Read keypad column 1 PORTx[5) Vcc 10 K Read keypad col umn 2 PORTx[6] Vcc 10 K Read keypad column 3 PORTx[7] 0 Assert PORT keypad row o o PORTkeypad row11 PORT2 keypad row2 2 4 Assert Assert Assert keypad row 3 3 PORTx 3] Vcc 4 10 K Read kevpad column 0 PORTx 4] Vcc 10 K Read keypad column 1 PORTx[5) Vcc 10 K Read keypad col umn 2 PORTx[6] Vcc 10 K Read keypad column 3 PORTx[7]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
