Task: 1. Horizontal flow of water 2. Vertical water flow 3. Oblique water discharge 1. Horizontal flow of water Source program: /****************************************************** **************************** Author: Liu Haitao Version: First time Date: July 23, 2010 Description: The order of the running lights is P0, P1, P2, P3 from 0 to 7 bits. *************************************************** *******************************/ /**********************************Header file**************************************/ #include "reg52.h" /****************************************************** *******************************/ /****************************************************** **************************** Function name: delay(), delay function. Macro definition: None Input: None Output: None *************************************************** *******************************/ delay(unsigned int dat) //Function definition { unsigned int i,j; for(i=0;i<=dat;i++) { for(j=0;j<=20000;j++); } } void main(void) //main function { unsigned char i; while(1) //loop { for(i=0;i<8;i++) { P0=0x01<=8) { a=i-8; } P1=0x01<=8) { b=b-8; } P2=0x01<=8) { c=c-8; } P3=0x01<
Previous article:Summary of Design and Production of Electronic Temperature Alarm
Next article:Programming Several Marquees Using Single-Chip Microcomputer
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- 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
MoreDaily News
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
Guess you like
- SCI Configuration of C2000 LaunchPad
- :Practical Analog Circuit Design Technology-Section 1
- The rice dumplings exchanged for Chip Coins arrived so quickly
- ADC and analog switch issues
- [BearPi-HM Nano, play with Hongmeng "Touch and Go"]-3-HarmonyOS compilation architecture learning record
- #idlemarket# nRF6936 Nordic IOT Sensor Kit Thingy: 52 Bluetooth module nRF52832
- Can NXP's crossover processor RT1052 execute code in RAM?
- What are the consequences of not connecting high-power wireless data transmission equipment to an antenna?
- 【Application Case】How to implement anti-lost device with Bluetooth BLE
- How do C1 and C2 supercapacitors work?