/* Main.c file generated by New Project wizard
*
* Created: ?? 5? 18 2017
* Processor: AT89C51
* Compiler: Keil for 8051
*/
#include
#include
#define uchar unsigned char
uchar u = 0,scond = 0;
uchar duan[] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void delay()
{
uchar j = 100;
while(j--);
}
void main(void)
{
TMOD = 0x01;
ET0 = 1;
TR0 = 1;
EA = 1;
TH0 = (65535-50000)/256;
TL0 = (65535-50000)%256;
P2 = duan[scond/10];
P3 = duan[scond%10];
while(1);
}
void timer(void) interrupt 1
{
TH0 = (65535-50000)/256;
TL0 = (65535-50000)%256;
u++;
if(u == 20)
{
u = 0;
scond++;
if(scond == 60)
{
scond = 0;
}
}
P2 = duan[scond/10];
P3 = duan[scond%10];
}
Previous article:Buzzer Class Code
Next article:Serial communication
- 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
- Selling Raspberry Pi 3b+ with 7-inch display and camera, beaglebone black, nrf52840 original development board
- How to design amplifier circuits with different frequencies?
- Download the LTpowerPlanner System-Level Design Tool Quick Start Guide for free
- DB9 pin type: RS485 output signal and terminal pin assignment
- Loop-Powered 4mA to 20mA RTD Temperature Transmitter Reference Design with MSP430 Smart Analog Combo
- Can you guys answer my question about 74HC04?
- OFDR for short-range high-precision measurements
- FPGA instantiation issues
- EEWORLD University ---- MSP430 capacitive touch technology - waterproof Demo
- Study for the rise of China! Hainan student with full score chooses to enter Tsinghua University to make chips