#include "stdio.h"
#include "reg51.h"
void init(void) ;
void display(void) ;
void Cal_cn(void) ;
void Cal_val(void) ;
if(fKey) { // Is a key pressed?
fKey = 0 ; // Clear the key flag and process the key
for(i=0 ;i<6 ;i++) buffer = 0 ;
TR0 = 0 ;
TL0 = 0x12 ;
TH0 = 0xf7 ; // 0xf712 for 2.5ms
TR0 = 1 ;
OldKey1 = Key1 ; OldKey2 = Key2 ; OldKey3 = Key3 ;
P1 = 0xff ; P3 = dig[scan] ;
ch = buffer[scan] ; // Display 6 digits in sequence
scan++ ; if(scan==6) scan = 0 ;
count1++ ;
if(count1==200) { count1 = 0 ; blink = ~blink ; } // 0.5s blinking timer
if(OverTime) { OverTime-- ; if(OverTime==0) modify = 0 ; } // 10s timeout timer
cn = 0 ;
for(i=0 ;i<6 ;i++) {
cn *= 10 ; cn += val ;
}
tmp = cn ;
for(i=0 ;i<6 ;i++) {
val[5-i] =(unsigned char) ( tmp % 10 ) ;
tmp = tmp / 10 ;
}
tmp = cn ;
for(i=0 ;i<6 ;i++) {
buffer[5-i] =(unsigned char) ( tmp % 10 ) ;
tmp = tmp / 10 ;
}
Previous article:Micro printer C51 control program
Next article:Detailed explanation of the indirect addressing method of 51 base address offset
Recommended ReadingLatest update time:2024-11-23 07:28
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- RS48 parallel garbled code problem
- [Help Post] High-frequency oscillation of high-frequency switching power supply current
- Pre-registration for the live broadcast with prizes: TI's latest application of millimeter-wave radar in the automotive field
- Can DLP dynamic projection be used to create a prototype of the famous ancient Chinese sword - the Hanguang Sword?
- Smart wearable classic data collection
- Design Considerations for Electric Vehicle Charger Circuit Topologies
- SHT31 Review - Unboxing and First Impressions
- Application of GPS in Power System
- HuaDa MCU Ucos FreeRtos RTThread real-time operating system
- Matrix switching in video surveillance systems: two implementation schemes for character overlay