PERCOBAAN - LAMPU METEOR
Nama Kelompok :
1. Riski Ariyanto / 163600047
2. Mufti Maulana Rahman / 163600059
Tujuan : Untuk membuat lampu Meteor
PROGRAM :
int pin [] = {3,5,6,9,10,11};
void setup(){
Serial.begin (9600);
for (int i=0;i<6;i++){
pinMode(pin[i],OUTPUT);
}
}
void setled (int x0,int x1,int x2,int x3,int x4,int x5){
int x[]= {x0,x1,x2,x3,x4,x5};
for(int i=0;i<6;i++){
analogWrite(pin[i],x[i]);
}
}
void loop(){
int x[]={0,0,0,0,0,0,250,200,150,100,50,10,0,0,0,0,0,0};
for (int i=0;i<13;i++){
setled(x[i+5],x[i+4],x[i+3],x[i+2],x[i+1],x[i]);
delay (90);
}
delay(500);
}
1. Riski Ariyanto / 163600047
2. Mufti Maulana Rahman / 163600059
Tujuan : Untuk membuat lampu Meteor
PROGRAM :
int pin [] = {3,5,6,9,10,11};
void setup(){
Serial.begin (9600);
for (int i=0;i<6;i++){
pinMode(pin[i],OUTPUT);
}
}
void setled (int x0,int x1,int x2,int x3,int x4,int x5){
int x[]= {x0,x1,x2,x3,x4,x5};
for(int i=0;i<6;i++){
analogWrite(pin[i],x[i]);
}
}
void loop(){
int x[]={0,0,0,0,0,0,250,200,150,100,50,10,0,0,0,0,0,0};
for (int i=0;i<13;i++){
setled(x[i+5],x[i+4],x[i+3],x[i+2],x[i+1],x[i]);
delay (90);
}
delay(500);
}
Komentar
Posting Komentar