Static:
#include sbit dula=P2^6; //digital tube register sbit wela=P2^7; //bit register void main() { temperature=1; P0=0xf8; wela=0; //Determine which digital tubes are lit and keep their status game=1; P0=0x3f; //Displayed number game=0; while(1); //Keep on }
dynamic:
#include sbit dula=P2^6; sbit temperature=P2^7; unsigned char num; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00}; //Define an array to store the values of the digital tubes that are about to light up void delay(unsigned int z) ; void main() { temperature=1; P0=0xc0; wela=0; // Make all digital tubes light up and keep the status unchanged while(1) { for(num=0;num<16;num++)//Loop light up { game=1; P0=table[num]; game=0; delay(200); //delay to achieve the flashing effect } } } void delay(unsigned int z) //delay function { unsigned int x,y; for( x=0;x<50;x++) for(y=0;y
Previous article:51 static and dynamic display digital tube
Next article:51 single chip microcomputer static digital tube display
- 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
- 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
- Threshold voltage question
- I need help from the teacher, the communication failure of the adaptive cruise control is
- What is the difference between the AFE module in the automotive BMS and the general metering chip?
- Important network technologies of 5G system
- Questions about relay circuits
- Start broadcasting at 10:00: Enter the TI robot production classroom and start the journey of deep learning practice! (100% courtesy for invitation viewing)
- Image Processing and Computer Vision Algorithms and Applications (2nd Edition)
- Tips: How to introduce version information into SMT32 firmware
- Weekly review information delivered——I said I would not launch any new products, but now I have launched new activities. Come and see the new activities~
- Detailed explanation of GPIO input and output modes