Scrolling display 0~7
source code
1 #include
2 #define uchar unsigned char
3 #define uint unsigned int
4 uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0xff}; //Code table for numbers 0~F. This program only uses 0~7
5 uchar code tab[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; //The address changes from left to right. 1~8 correspond to pins with high level valid. This program is better to use bit left shift operation.
6 void delay(uint z)
7 {
8 uint x,y;
9 for(x=z;x>0;x--)
10 for(y=110;y>0;y--);
11 }
12 void main()
13 {
14 uint i;
15 while(1)
16 {
17 for(i=0;j<8;i++)
18 {
19 P0=table[i];
20 P2=tab[i];
21 delay(500);
twenty two
twenty three }
twenty four }
25 }
Previous article:I also play with single chip microcomputer: running water lamp
Next article:Microcontroller: The smallest unit of STC89C52
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- How to carry out wireless monitoring in harsh outdoor environments?
- Award-winning domestic chip live broadcast: Xianji 800MHz RISC-V MCU high-energy show, more than just controlling 4 servo motors, a lot of practical information
- EEWORLD University Hall----Live Replay: Explore the Black Technology Behind Smart Door Locks with Infineon
- I have basic knowledge of embedded C programming and almost no knowledge of digital electronics. How long will it take to self-study FPGA to Ethernet communication?
- [Ended] Buy now: Free shipping for new users of e-Network is about to end, post your order and leave a message to get a surprise~
- Chip plagiarism, fined 4 million yuan!
- TIOBE August 2022 Ranking
- Reading Notes of the Good Book "Electronic Engineer Self-study Handbook" 02-Keil uVision4 & STC
- I received the book on the basics of power supply design and I feel it is necessary to share it
- IEC61000-4-5 coupling mode