Flashing like fire effect a flickering random light effect on 3 LED, using PWM (Pulse with Modulation), This project you cud plug it in DIY Buildings, Home, Cars, and Robots to have special FX
Parts Required
Arduino UNO/MEGA/NANO
1x RED LED
2x YELLOW LED
3x 220 Ohms Resistor
Wiring the parts to Arduino
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
/* For 14core starter kit */ int ledPin1 = 9; //Define Pin 9 LED1 int ledPin2 = 10; //Define Pin 10 LED2 int ledPin3 = 11; //Define Pin 11 LED3 void setup() { pinMode(ledPin1, OUTPUT); pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT); } void loop(){ analogWrite(ledPin1, random(120)+135); //Random analogWrite(ledPin2, random(120)+135); analogWrite(ledPin3, random(120)+135); delay(random(100)); //Delay for 1 milliseconds } |
Flashing LED FX Random light effect on PWM