20 微电子 2 班 周叶思豪 202008384229
1、流水灯
程序代码:
#include<intrins.h>
#include<reg51.h>
void DelayTime10ms(unsigned int DelayValue);
void main()
{
unsigned char i=0;
unsigned char temp=0xfe;
while(1)
{
for(i=0;i<8;i++)
{
P2=temp;
DelayTime10ms(100);
temp=_crol_(temp,1);
}
}
}
void DelayTime10ms(unsigned int DelayValue)
评论0