If the delay function is used to detect the key press, it will consume the memory of the microcontroller, which is not very good, so we have the following method:
unsigned char cnt1 = 0XFF;
cnt1 = (cnt1<<1)|KEY1;
if(cnt1!=0x00)
{
KeyLock = 0;
}
else if (KeyLock==0)
{
KeyNum = 1;
KeyLock = 1; //Prevent key triggering
}
Previous article:51 MCU Learning Notes——8. A wonderful algorithm for lighting the running lights
Next article:51 MCU Learning Notes——6. Interrupt method to configure timer
- 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
- F2833x calls DSP function library to implement complex FFT method
- 【Practical】Eliminating EMI in Buck Converters (2)
- Doom ported to small devices based on nRF52840
- How to protect embedded systems from attacks?
- I can't find the data sheet of Shanghai Huahong SHC6601 on their official website. I'm really helpless. Please help me provide it.
- Looking for Mentor Graphics WG2004
- Texas Instruments (TI) Automotive Month - "Core" Drives New Future
- millimeter wave, millimeter wave radar, millimeter wave sensor, 5G and millimeter wave,
- PMOS is used as solid-state relay, high-side bidirectional switch, anti-current backflow, anti-reverse connection circuit
- MSP430F5529 LAB CODE experimental routine