|
楼主 |
发表于 2013-5-3 20:21
|
显示全部楼层
int Led1=1;
int Led2=2;
int Led3=3;
int Led4=4;
int Led5=5;
void style_1(void)
{
unsigned char j,k;
k=4;
for(j=1;j<=3;j++)
{
digitalWrite(j,HIGH);
digitalWrite(j+k,HIGH);
delay(400);
digitalWrite(j,LOW);
digitalWrite(j+k,LOW);
delay(400);
k-=2;
}
void flash(void)
{
unsigned char j,k;
for(k=0;k<=3;k++)
{
for(j=1;j<=6;j++)
digitalWrite(j,HIGH);
delay(200);
for(j=1;j<=6;j++)
digitalWrite(j,LOW)
delay(200;)
}
}
void setup()
{
unsigned char i;
for(i=1;i<=6;i++)
pinMode(i,OUTPUT);
}
void loop()
{
style_1();
flash();
}
这个程序看下对不对,不对的话,怎么改 |
|