1. Programming scan method: When the microcontroller is idle, the keyboard scan subroutine is called to scan the keyboard repeatedly, waiting for the user to input commands or data from the keyboard to respond to the keyboard input request.
2. Timing scanning mode: The single-chip microcomputer can also use timing scanning mode to scan the keyboard, that is, scan the keyboard once every certain time.
3. Interrupt work mode: Only when a key is pressed on the keyboard, the keyboard scanning program and the key function program are executed. If no key is pressed, the microcontroller will ignore the keyboard.