#define uint unsigned int
#define uchar unsigned char
uint num
void delay(uint x)
{
uint i,j
for(i=0i<xi++)
for(j=0j<120j++)
}
void main()
{
uchar temp
while(1)
{
temp=0xfe
for(num=0num<7num++)
{
P1=temp
temp=temp<<1
delay(500) //0.5s
}
for(num=0num<8num++)
{
P1=temp
temp=temp>>1|0x80
delay(500)
}
P1=0xff
delay(500)
for(num=0num<4num++)
{
P1=0X00
delay(500)
P1=0xff
delay(500)
}
}
}
#include<reg51.h>void delay(int a)
{
while(a--)
}
main()
{
unsigned char i
while(1)
{
P0=0xff
for(i=0i<8i++){P0=P0<<亏芦1delay(30000)}
P0=0x00
for(i=0i<销伏带8i++){P0=(P0>>厅橡1)|0x80delay(30000)}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)