#define pinLedCandle PB0
#define pinLedCandle2 PB1
byte Flicker_table[] = { 10, 10, 20, 30, 30, 30, 40, 50, 60, 70, 80, 70, 70,
60, 60, 50, 50, 50, 60, 70, 80, 90, 100,
120, 140, 160, 240, 250, 100, 150, 250, 250, 140,
240, 230, 220, 100, 80, 70, 70, 70, 80, 80,
140, 130, 120, 110, 200, 210, 220, 220, 100, 90,
40, 30, 30, 30, 20, 10, 10, 20, 30, 30, 30, 40, 50,
60, 70, 80, 110, 80, 70, 70, 60, 60, 50, 50,
};
int len = sizeof(Flicker_table);
void setup() {
pinMode(pinLedCandle, OUTPUT);
pinMode(pinLedCandle2, OUTPUT);
}
void loop() {
for ( int i = 0; i <= len; i++) {
analogWrite(pinLedCandle, Flicker_table[i]);
analogWrite(pinLedCandle2, Flicker_table[len - i]);
delay(60);
}
}