您的当前位置:首页单片机流水灯程序

单片机流水灯程序

2020-08-24 来源:爱问旅游网


#include

#include

typedef unsigned int uint8;

typedef unsigned int uint16;

sbit LED = P0^0;

sbit ENLED = P1^4;

sbit ADDR0 = P1^0;

sbit ADDR1 = P1^1;

sbit ADDR2 = P1^2;

sbit ADDR3 = P1^3;

main()

{

uint16 j;

uint8 i;

ENLED = 0;

ADDR0 = 1; ADDR1 = 1; ADDR2 = 1; ADDR3 = 1;

while(1)

{

P0 = ~(1<for(i = 0; i < 20000; i++);

if(j ==8 )

{

while(1)

{

P0 = ~(1<for(i = 0; i< 20000; i++);

if(j == 0)

{

break;

}

}

}

}

}

因篇幅问题不能全部显示,请点此查看更多更全内容