Lighting Up a Running Light with Right Shift Operations on the 51 Microcontroller
According to the principle of the running light, the IO port outputs a low level sequentially from low to high or from high to low.1. Experimental Wiring DiagramCode:Delay function: void delay(void)//Delay for a period of time{ unsigned int n; for(n=0;n<30000;n++) ;} main function: void main(void){ unsigned char i; while(1) { P1=0xff;//Initialize P1 delay(); for(i=0;i<8;i++)//Set loop … Read more