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
Get step-by-step solutions from verified subject matter experts
