#include<STC89C5xRC.h>
void delay()//provide delay
{
int i,j;
for(i=0;i<120;i++)
for(j=0;j<120;j++)
{
;
}
}
int main()
{
while(1)
{
P2=0xFF; // All eight lights are off
delay();
P2=0xE7;
delay();
P2=0xC3;
delay();
P2=0x81;
delay();
P2=0;
delay();
}
}
Design ideas:
1 1 1 1 1 1 1 1 //P2=0xFF
1 1 1 0 0 1 1 1 //P2=0xE7
1 1 0 0 0 0 1 1 //P2=0xC3
1 0 0 0 0 0 0 1 //P2=0x81
0 0 0 0 0 0 0 0 //P2=0
Previous article:Two-degree-of-freedom automatic sampling detector control (Version 1.1)
Next article:8051 MCU (STC89C52) countdown timer
Recommended ReadingLatest update time:2024-11-16 11:32
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- STC32G Series MCU Technical Reference Manual
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
- The difference between the two half-bridge drive circuits
- Allwinner heterogeneous multi-core AI intelligent vision V853 development board evaluation - v853 YOLO v5 quantization -> installation of yoloV5
- [ST NUCLEO-U575ZI-Q Review] + Multi-channel ADC data acquisition
- Today's live broadcast: TI Matter solutions help smart home innovation
- Years of points exchanged for a watch
- e-Network Limited Time Benefits|"e-Select"-------Show Order
- Please advise on capacitor charging and discharging and parallel capacitor problems
- [ ST NUCLEO-U575ZI-Q Review] Share GPDMA information
- Raspberry Pi Official Manual 2023
- [Pingtouge Boliu BL606P audio and video development board] Unboxing and setting up the development environment HelloWorld