Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following code and keypad layout, what will the function GetKey() return when it is run while keys 2, 3, 7, B, E, and

Given the following code and keypad layout, what will the function GetKey() return when it is run while keys 2, 3, 7, B, E, and F are pressed? image text in transcribed DDRH = 0x0F; RDRH = 0x00; PERH = 0x00; PIEH = 0x00; PTH = 0x0F; unsigned char GetKey(void) { unsigned char KeyMask[16] = { 0xEE, 0xDE, 0xBE, 0x7E, 0XED, 0xDD, 0xBD, 0x7D, 0xEB, 0xDB, 0xBB, 0x7B, 0xE7, 0xD7, 0xB7, 0x77 }; int i; char Key; for (Key=0, i=0; i { PTH = KeyMask[i]; if (PTH == KeyMask[i]) { if (i else Key = A+ i - 10; } } PTH = 0x0F; return (Key); }

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Define the attributions we use to explain behavior

Answered: 1 week ago