//★★★★★★★★★Use of MCU I/O port★★★★★★★★★★★\\
//MCU model: PIC16F877A
//Function description: Make the RC0 port light flash
#include
__CONFIG(0XF73A); //Chip configuration word
void delay(); //delay function declaration
//==============================================================================
//Function: main function
//Function name: void main()
void main() //Main function
{
TRISC=0X00; //Port C is defined as outputwhile
(1) //Infinite loop, let the port C running light work all the time
{
PORTC=0X01; //Let the RC0 port light flash on and off
delay(); //Delay, ensure brightness and time so that the naked eye can see the phenomenon
PORTC=0X00;
delay();
}
}
//=================================================================================
//Function function: delay function
//Function name: void delay()
void delay() //Delay subroutine
{
int i; //Define integer variable
for(i=0x65535;i>0;i--)
{;} //Empty function, does not execute anything, just consumes a certain amount of time
}
Previous article:Use of LCD1602A
Next article:Basic I/O port operations
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- [Hua Diao Experience] 16 Use Beetle ESP32 C3 to control 8X32-bit WS2812 hard screen
- It’s hard to believe that this pair of high-speed signals changed the vias so many times!!!
- [Infineon XENSIV PAS CO2 sensor] Simple unboxing
- An article to understand the analysis and calculation of electrolytic capacitor life
- FreeRTOS in the JIHAI APM32E103VET6 review
- Wu Jianying's live video sharing of microcontroller lectures
- ESP32-C3 Debug Diary
- LPS28DFW driver and related information
- Battery Test Equipment --- Signal Chain
- Summary of basic issues of ADC