Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me please to convert this Sudoku code into Assembly byte readKey(){ byte ch; do { PORTA = 0x0F; //set all output pins PA7-PA4 to

Help me please to convert this Sudoku code into Assembly

byte readKey(){

byte ch;

do

{

PORTA = 0x0F; //set all output pins PA7-PA4 to 0

while(PORTA == 0x0F) // Checking for the leading edge //bits PA3-PA0 are 1 until a key is pressed)

{

code = PORTA; // get the keycode from the user

delayms(10); //Delay for the debounce of button

}

}while(code != PORTA); //start again when PORTA changes

code = readKeyCode(); //call readKeyCode to get keycode

PORTA = 0x0F; // set pins PA7-PA4 to 0

while(PORTA != 0x0F) // wait for trailing edge

{

delayms(10); //delay for the debounce of the key

}

ch = translate(code);//call translate to get ASCII code

return(ch);

}

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

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

1. Which position would you take?

Answered: 1 week ago