27,382
社区成员
发帖
与我相关
我的任务
分享
#include <reg52.h>
void delayms( unsigned char xms);
void main()
{
unsigned char x;
while(1)
{
P0 = 0x00;
x = P0;
P1 = x;
delayms(5000);
P0 = 0xFF;
x = P0;
P1 = x;
}
}
void delayms(unsigned char xms)
{
unsigned char i,j;
for(i = xms; i>0; i--)
for(j = 120; j>0; j--);
}
volatile unsigned char x;