Keil Cx51 program:
#include
sbit VD9=P0^0;
sbit VD11=P0^2; sbit VD12=P0^3;
sbit VD13=P0^4; sbit VD14=P0^5;
sbit VD15=P0^6; sbit VD16=P0^7;
sbit VD1=P1^0; sbit VD2=P1^1;
sbit VD3=P1^2; sbit VD4=P1^3;
sbit VD5=P1^4; sbit VD6=P1^5;
sbit VD7=P1^6; sbit VD8=P1^7;
sbit VD17=P3^0;
sbit VD19=P3^2; sbit VD20=P3^3;
sbit VD21=P3^4; sbit VD22=P3^5;
sbit VD23=P3^6; sbit VD24=P3^7;
sbit VD25=P2^0; sbit VD26=P2^1;
sbit VD27=P2^2; sbit VD28=P2^3;
sbit VD29=P2^4; sbit VD30=P2^5;
sbit VD31=P2^6; sbit VD32=P2^7;
void delay(){unsigned char i,j;
for(i=0;i<255;i++)
for(j=0;j<255;j++);}
void main()
{
while(1)
{
//P1口循环亮
VD32=1;VD1=0;delay();
VD1=1;VD2=0;delay();
VD2=1;VD3=0;delay();
VD3=1;VD4=0;delay();
VD4=1;VD5=0;delay();
VD5=1;VD6=0;delay();
VD6=1;VD7=0;delay();
VD7=1;VD8=0;delay();
//P0口循环亮
VD8=1;VD9=0;delay();
VD9=1;VD10=0;delay();
VD10=1;VD11=0;delay();
VD11=1;VD12=0;delay();
VD12=1;VD13=0;delay();
VD13=1;VD14=0;delay();
VD14=1;VD15=0;delay();
VD15=1;VD16=0;delay();
//P3口循环亮
VD16=1;VD17=0;delay();
VD17=1;VD18=0;delay();
VD18=1;VD19=0;delay();
VD19=1;VD20=0;delay();
VD20=1;VD21=0;delay();
VD21=1;VD22=0;delay();
VD22=1;VD23=0;delay();
VD23=1;VD24=0;delay();
//P2口循环亮
VD24=1;VD25=0;delay();
VD25=1;VD26=0;delay();
VD26=1;VD27=0;delay();
VD27=1;VD28=0;delay();
VD28=1;VD29=0;delay();
VD29=1;VD30=0;delay();
VD30=1;VD31=0;delay();
VD31=1;VD32=0;delay();
}
}
Previous article:Summary of 51 MCU timer counter interrupt
Next article:Microcontroller simulation of proteus and keil Cx51 (button lighting)
Recommended ReadingLatest update time:2024-11-16 17:37
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Single-chip microcomputer C language programming and simulation
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Single chip microcomputer control technology (Li Shuping, Wang Yan, Zhu Yu, Zhang Xiaoyun)
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
- Live broadcast at 10 am today [Infineon Smart Door Lock Solution]
- [GD32E231 DIY Contest] Getting Started
- [CB5654 Intelligent Voice Development Board Review] Demonstration of Voice Recognition Processing
- Install Debian 8 system
- CC2640 CC1310 high and low temperature test
- Detailed explanation of TL494 switching power supply circuit
- STM32MP157A-DK1 Evaluation + IIO and ADC (6)
- 【Qinheng RISC-V core CH582】 5 Bluetooth routine initial evaluation and environment construction
- RISC-V MCU IDE MRS (MounRiver Studio) development: Solve the problem of RAM usage showing 100% after compilation
- FPGA Learning - Introduction to Verilog