#define MAIN_Fosc 22118400L //Define the main clock
#include "STC15Fxxxx.H"
/********* Function description*** The program uses P4.7 P4.6 P1.6 P1.7 to demonstrate the marquee and output low drive. **********/
void delay_ms(u8 ms);
/************************ Main function******************/
void main(void)
{
P0M1 = 0; P0M0 = 0; //Set to quasi-bidirectional port
P1M1 = 0; P1M0 = 0; //Set to quasi-bidirectional port
P2M1 = 0; P2M0 = 0; //Set to quasi-bidirectional port
P3M1 = 0; P3M0 = 0; //Set to quasi-bidirectional port
P4M1 = 0; P4M0 = 0; //Set to quasi-bidirectional port
P5M1 = 0; P5M0 = 0; //Set to quasi-bidirectional port
P6M1 = 0; P6M0 = 0; //Set to quasi-bidirectional port
P7M1 = 0; P7M0 = 0; //Set to quasi-bidirectional port
while(1)
{
P17 = 0;
delay_ms(250);
delay_ms(250);
P17 = 1;
P16 = 0;
delay_ms(250);
delay_ms(250);
P16 = 1;
P47 = 0;
delay_ms(250);
delay_ms(250);
P47 = 1;
P46 = 0;
delay_ms(250);
delay_ms(250);
P46 = 1;
}
}
void delay_ms(u8 ms)
{
u16i;
do{
i = MAIN_Fosc / 13000;
while(--i); //14T per loop
}while(--ms);
}
Previous article:Write a running water lamp program in assembly language
Next article:Use AT89C51 microcontroller to display countdown program
- 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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- A fire at a Huawei construction site in Songshan Lake, Dongguan killed three people? Official response: It has nothing to do with the laboratory
- Automatic focusing system based on DSP chip TMS320F206 for numerical calculation and implementation control
- NU514-RGBW four-way control constant current linear constant current IC
- Common usage of MSP430 watchdog and writing method of interrupt function
- MQBoard - MicroPython microframework for managing MQTT
- BT8896A Specification (Zhongke Bluexun)
- What is the amplification factor of this op amp?
- Multisim simulation of infinite gain multi-channel negative feedback (MFB) second-order Butterworth low-pass filter
- Help with "How to select capacitor voltage for VBAT pin of SIM900A?"
- Request a Free VICOR UHV BCM Evaluation Sample