Comprehensive Guide to 80 Microcontroller Programming Examples
*Example 1: Use P3 port to light up 8 LEDs in sequence #include<reg51.h> // Include microcontroller register header file / Function: Delay for a certain period of time void delay(void) { unsigned char i,j; for(i=0;i<250;i++) for(j=0;j<250;j++) ; } / Function: Main function void main(void) { while(1) { P3=0xfe; // First light on delay(); // Call … Read more