#include<reg51.h>
#include<intrins.h>
#define xyh unsigned int
#define lq unsigned char
lq bf;
sbit loving=P2^5;
void love (xyh);
void main()
{
P2=0;
P0=0;
bf=0xfd;
bf=1;
while(1)
{
P0=bf;
love(100);
bf=_crol_(bf,1);
loving=1;
love(100);
loving=0;
love(100);
}
}
void love (xyh rich)
{
xyh she,he;
for(she=100;she>0;she--)
for(he=rich;he>0;he--);
}
蜂鳴器發聲
流水燈左移
流水燈每左移一次蜂鳴器滴答一次
這都是薛yh的功勞
|