Use 51 single-chip microcomputer to write a program of running water lamp with 5 lamps

You can refer to the following code: //Define MCU port sbit P1_0=P1^0; sbit P1_1=P1^1; sbit P1_2=P1^2; sbit P1_3=P1^3; sbit P1_4=P1^4;//Define macro Definition #define Off(x) x=0 #define On(x) x=1//Program entry void main () { while (1) { //The first light On(P1_0); Delay_ms(500); Off (P1_0); Delay_ms(500);

//The second light On(P1_1); Delay_ms(500); Off(P1_1)

Guess you like

Origin blog.csdn.net/weixin_35750747/article/details/129503563