/*
Hacked from "single flickering LED"
*/
int ledOr = PB0;
int ledYe = PB1;
int ledWh = PB3;
int ledBl = PB2;
int ledQq = PB4;
int brightnessOr = 5;
int fadeAmountOr = 15;
int brightnessYe = 0;
int fadeAmountYe = 25;
int brightnessWh = 5;
int fadeAmountWh = 5;
int brightnessBl = 25;
int fadeAmountBl = 20;
int brightnessQq = 45;
int fadeAmountQq = 5;
void setup() {
pinMode(PB0, OUTPUT);
pinMode(PB1, OUTPUT);
pinMode(PB3, OUTPUT);
pinMode(PB2, OUTPUT);
pinMode(PB4, OUTPUT);
}
void loop() {
analogWrite(ledBl, brightnessBl);
{
analogWrite(ledOr, brightnessOr); // set the brightness of pin 9:
brightnessOr = brightnessOr + fadeAmountOr; // change the brightness for next time through the loop:
if (brightnessOr <= 5 || brightnessOr >= 255) {
fadeAmountOr = -fadeAmountOr;
delay(random(2,100));
}
}
{
analogWrite(ledYe, brightnessYe); // set the brightness of pin 9:
brightnessYe = brightnessYe + fadeAmountYe; // change the brightness for next time through the loop:
if (brightnessYe <= 0 || brightnessYe >= 255)
{
fadeAmountYe = -fadeAmountYe;
delay(random(10,127));
}
}
{
analogWrite(ledWh, brightnessWh); // Actually is Blue Led
brightnessWh = brightnessWh + fadeAmountWh;
if (brightnessWh <= 5 || brightnessWh >= 155)
{
fadeAmountWh = -fadeAmountWh;
delay(random(3,137));
}
}
{
digitalWrite(PB2, brightnessBl); // actually is White OR Yellow LED
delay(10); // Wait
digitalWrite(PB2, fadeAmountBl); //
delay(27); // Wait
{
digitalWrite(PB2, random(11));
delay(7);
}
}
{
digitalWrite(PB4, brightnessQq); // actually is White OR Yellow LED
delay(10); // Wait
digitalWrite(PB4, fadeAmountQq); //
delay(47); // Wait
{
digitalWrite(PB4, random(17));
delay(9);
}
}
}