Program:
#include
void delay(unsigned int d);
char t;
unsigned char code duan[] = {0x3f,0x06,
0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x40} ;
unsigned char code wei[8]={0xfe,0xfd,0xfb
,0xf7,0xef,0xdF,0xbF,0x7F};
main()
{
unsigned int f=1,n=0;
unsigned char i,out[8];
t=0;
while(1)
{
if(++t>=1)
{
t=0;
++f;
if(f==10000)
{f=0;
n++;
}
if(n==10000)
{
n=0;
}
}
out[4]=duan[f%10000/1000]; //thousands
out[5]=duan[f%1000/100]; //hundreds
out[6]=duan[f%100/10 ]; //Tens digit
out[7]=duan[f%10]; //Ones digit
out[0]=duan[n%10000/1000]; //Ten million
out[1]=duan[n%1000 /100]; //one million
out[2]=duan[n%100/10]; //one hundred thousand
out[3]=duan[n%10]; //ten thousand
for( i=0; i<8 ; i++)
{P1=wei[1];
P0 = out[i];
P1 = wei[i];
delay(10);
}
}
}
Previous article:STC MCU internal EEPROM program
Next article:Realizing the Spectrum Display of Audio Signals Using 51 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
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- 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)
- [Mil MYB-YT507 development board trial experience] Unboxing + HELLOWORLD
- How many versions of the C language main function are there? Which one is right?
- stm32f4 serial port 3 prompts NE error
- Design and implementation of asynchronous FIFO based on Verilog HDL.pdf
- The common-mode gain, differential-mode gain, and power supply rejection ratio of the op amp are shown in the figure.
- 01. Environment construction and driving 0.96OLED
- 【RT-Thread software package application work】Small alarm clock
- High-side current sampling problem
- China's first batch of autonomous driving unmanned commercial licenses issued! Do you dare to sit in an unmanned car? ?
- GDB debugging and DSP