Percobaan 1 kondisi 15 :
Hidupkan LED seluruhnya lalu matikan bergantian dari kiri ke kanan.
4. Listing program [kembali]
int led[]={2,3,4,5,6,7,8,9};
int k,a,b,c;
void setup() {
for(k=0;k<8;k++)
{pinMode(led[k],OUTPUT);
}
}
void loop() {
for(a=0;a<8;a++) {
digitalWrite(led[a],LOW);
delay(100);
}
for(b=0;b<5;b++ & c=8;c>4;c-- ){
digitalWrite(led[b,c],HIGH);
delay(1000);
}
}
int led[]={2,3,4,5,6,7,8,9};
int k,a,b,c;
void setup() {
for(k=0;k<8;k++)
{pinMode(led[k],OUTPUT);
}
}
void loop() {
for(a=0;a<8;a++) {
digitalWrite(led[a],LOW);
delay(100);
}
for(b=0;b<5;b++ & c=8;c>4;c-- ){
digitalWrite(led[b,c],HIGH);
delay(1000);
}
}
6. Link download [kembali]
Tidak ada komentar:
Posting Komentar