我用的51系列,供你参考,LED接在P0端口,延时的长短您可以自己控制,修改一下void DelayMS(uint x)中的i和void main()中的x就行了。
#include
#include
#define uchar unsigned char
#define uint unsigned int
void DelayMS(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}
void main()
{
P0=0xfe;
while(1)
{
P0=_crol_(P0,1);
DelayMS(150);
}
}
貌似我有哦《〈你是做屏的吗?