Stage Effects

Candle Flicker Effect

Build your own LED flickering candle using three light sources. Sketched and beta tested using an Arduino Uno. This code can easily be written to an ATTiny chip for embedded electronics (e.g. hide it in an actual candle).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* LED candle flicker effect for 
Don Quixote, Cornish College of the Arts
Fall 2015-2016
 
Brendan Patrick Hogan
Sound Design Area Head | Performance Production
*/
 
int ledPin1 = 9; // yellow LED 1
int ledPin2 = 10; // yellow LED 2
int ledPin3 = 11; // red LED 1
 
void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
 
void loop() {
analogWrite(ledPin1, random(10)+120); // yellow 1
analogWrite(ledPin2, random(80)+80); // yellow 2
analogWrite(ledPin3, random(100)+10); // red 1
delay(random(100));
}

HoganSound