The dynamic scanning method is used to display a stable 654321 on the six-digit digital tube.
The clock frequency is 11.0592M
#include
#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^6;
sbit wela=P2^7;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void display(uchar,uchar,uchar,uchar,uchar,uchar); //Function declaration
void delay(uint);
void main()
{
}
void display(uchar one,uchar two,uchar three,uchar four,uchar five,uchar six)
{
}
void delay(uint z)
{
}
Procedure 2
Use the dynamic scanning method and timer 1 to display the stopwatch in the first three digits of the digital tube,
accurate to 1% of a second, that is, the last digit displays 1% of a second, and the cycle continues.
#include
#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^6;
sbit wela=P2^7;
uchar ge,shi,bai;
uint tt;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void display(uchar,uchar,uchar); //Function declaration
void delay(uint);
void main()
{
}
void exter0() interrupt 3
{
}
void display(uchar one,uchar two,uchar three)
{
}
void delay(uint z)
{
}
[page]
Procedure 3
Using dynamic scanning and timer 1, the digital tube displays a number
starting from 765432 and decreasing at a speed of 1/10 second
until 765398 and keeps displaying this number. At the same time, using
timer 0 at a speed of 500MS, the running lights move from top to
bottom. When the number on the digital tube decreases to a stop,
the running lights on the experimental board also stop and then all start flashing. After 3 seconds
(using T0 timing), all the running lights turn off and the digital tube
displays "HELLO". Keep it here.
#include
#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^6;
sbit wela=P2^7;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,
0x76,0x79,0x38,0x3f,0};
uchar temp,t0,t1,bai,shi,ge,flag,flag1;
uint shu;
void init();
void display(uchar aa,uchar bb,uchar cc,uchar bai,uchar shi,uchar ge);
void delay(uint z)
{
}
void main()
{
}
void init()
{
}
void timer0() interrupt 1
{
}
void timer1() interrupt 3
{
}
void display(uchar aa,uchar bb,uchar cc,uchar bai,uchar shi,uchar ge) // display 子function
{
}
Previous article:51 MCU running light C language source program
Next article:51 MCU C language program (II) Timer/Counter interrupt
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- A 25-year-old DJI employee died suddenly of cardiac arrest, having just graduated with a master's degree
- C2000 chip calculation skills and precautions
- The beauty of algorithms
- Worried about switching from Class AB to Class D? No need to worry
- FPGA Simplified Design Method Case 2
- Power module viewing operation
- EEWORLD University Hall----Challenges and solutions for ultrasonic water and gas meter design
- TI Battery Charge Management IC Introduction --- bq25606 with 3A Charging Current
- The XMC4800 Relax EtherCAT Kit you want is here, apply for it quickly!
- EEWORLD University Hall----Unix Operating System