I spent a bit of last weekend experimenting with the Raspberry Pi, and I came up with a fake candle! I used the cap of an old Christmas light, a yellow LED, some small dowels drilled with holes, and a lot of superglue. Then I programmed it in Python using the software PWM so it flickers realistically. I didn’t use any solder, I just kind of twisted the wires together. I also made an Arduino version as well.
#The Pi Candle Code
#Amanda Cole 2015
import RPi.GPIO as GPIO, time, random
GPIO.setup(26, GPIO.OUT) #26 is the LED
flame = GPIO.PWM(26,60)