Tag Archives: code

Candlelight-Atmosphere with Arduino

7 Jan

Just a snipped of code that I have found for creating a candlelight-like light with a yellow LED attached to a PWM port of an Arduino (called here ledPin). You could probably add another red LED to optimize the effect, but for a first try it does not look too bad.

analogWrite(ledPin, random(120)+135);
delay(random(100));

Here is a small video of the setup in action:

Advertisements