Question
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
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