Paso 3: código
int r = 11;
int g = 10;
int b = 9;
int pv = 0;
int yv = 0;
void setup() {}
pinMode (r, salida);
pinMode (g, salida);
pinMode (b, salida);
}
void loop() {}
para (int rv = 1; rv < 204; rv ++) {}
analogWrite(r,rv);
Delay(10);
}
para (int rv = 255; rv > 1; rv--) {}
analogWrite(r,rv);
Delay(10);
}
para (int gv = 1; gv < 204; gv ++) {}
analogWrite(g,gv);
Delay(10);
}
para (int gv = 255; gv > 1; gv--) {}
analogWrite(g,gv);
Delay(10);
}
para (int bv = 1; bv < 204; bv ++) {}
analogWrite(b,bv);
Delay(10);
}
para (int bv = 255; bv > 1; bv--) {}
analogWrite(b,bv);
Delay(10);
}
while(PV<204) {}
analogWrite(r,pv);
analogWrite(b,pv);
Delay(10);
PV ++;
}
while(PV>1) {}
analogWrite(r,pv);
analogWrite(b,pv);
Delay(10);
PV;
}
while(YV<204) {}
analogWrite(r,yv);
analogWrite(g,yv);
Delay(10);
YV ++;
}
while(YV>1) {}
analogWrite(r,yv);
analogWrite(g,yv);
Delay(10);
YV;
}
}