LED candle effect

Arduino

Led candle effect using Arduino

Here is my attempt to make an LED candle. Version 2.0 is coming shortly. Come back to check it out.

Code
int LED = 13; //Digital Pin 13, the one with the resistor
void setup()
{
  pinMode(LED, OUTPUT);
}
void loop()
{
  int flame = random(50, 255); //changes brightness of flame
  analogWrite(LED,flame);
  int dly = random(50, 150); // to prevent the flicker from being to aggressive
  delay(dly);
}

 

Comments are closed.