Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned char get_key(void)
- {
- while((col_1) && (col_2) && (col_3))
- {}
- while(1){
- KEYPAD_PORT=0xFB;
- if(!col_1)
- { return(1); }
- if(!col_2)
- { return(2); }
- if(!col_3)
- { return(3); }
- KEYPAD_PORT=0x7F;
- if(!col_1)
- { return(4); }
- if(!col_2)
- { return(5); }
- if(!col_3)
- { return(6); }
- KEYPAD_PORT=0xBF;
- if(!col_1)
- { return(7); }
- if(!col_2)
- { return(8); }
- if(!col_3)
- { return(9); }
- KEYPAD_PORT=0xEF;
- if(!col_1)
- { return(10); }
- if(!col_2)
- { return(11); }
- if(!col_3)
- { return(12); }
- }
- }
Add Comment
Please, Sign In to add comment