There is a P1 port determinant keyboard program example at the back.
Hehe
Seeing the forum discussing keys, I also talked about my ideas for designing key programs. Welcome to criticize.
1. Generally, there is no delay in the keyboard program, but the keys are scanned by calling at intervals (such as 10 milliseconds) to release CPU resources as much as possible;
2. All keyboard programs are basically in one mode, which can handle accelerator keys, one-key multi-function, etc.;
3. There are only 2 external interfaces. To change to a keyboard with different hardware, you only need to add the keyboard program to the project and compile it. No other changes are required. It is very convenient.
Basically, it is a pattern:
Is there a key? - YES - the same as last time? - No - Keyold = 0; Exit
All keyboard program external interfaces:
unsigned
{
}
bit
{
}
//--------------------------------------------------------------------------//
//
//
//
//
//--------------------------------------------------------------------------//
//Title:
//File name:
//Version:
//Modifier:
//Date:
//Description:
//Statement:
//
//
//
//--------------------------------------------------------------------------//
//Old version:
//Created by:
//Date:
//--------------------------------------------------------------------------//
#i nclude
#i nclude
//#i nclude
#define
#define
unsigned
unsigned
unsigned
unsigned
bit
#define
#define
unsigned
//---------------------------------------------------------------------------//
void
}
//---------------------------------------------------------------------------//
unsigned
{
}
bit
{
}
Previous article:C51 program for single chip microcomputer to drive standard PC keyboard
Next article:Traffic light C language program based on AT89C52 single chip microcomputer
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Three failure modes of high-voltage connectors for new energy vehicles
- Is it necessary to take a shower for 10 minutes after a burn?
- Sensor Problems
- Latest solutions specifically for battery test equipment, 5G test equipment
- DCDC input capacitance waveform
- If anyone is willing to help improve the size of the building block library, we can share the profits in the future.
- EEWORLD University Hall ---- The second stop of the ADI Road theme tour of Shijian: Instruments
- The features of the SCI module are as follows (these functions can be set through the corresponding registers)
- A very basic question, how to understand the reading timing diagram?
- stm32f1 plays badaplle routine, modify the atomic routine, use vs1053 to decode audio, ucosII to do dual thread