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

2 Responses to “Candlelight-Atmosphere with Arduino”

  1. Amanda July 16, 2015 at 1:23 pm #

    The Minecraft temple model is so cool, especially with color and the caves in the side! Did you design it yourself?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: