Tag: Trinket

With Xmas not far away I’d ordered some LED tea Lights for the wife to make some decorations to give away to the family. I was interested to find out what was driving the LED, but because all the candles were required I was not able to autopsy one to find out. This got me thinking, I have an Adafruit Trinket that would be great to drive an LED via PWM and create the desired flame effect.

Now after searching the web for examples of what it was I wanted to do, I finally settled on this one from .ledhacker This is pretty much what I was after! Here’s a copy of that original code…

So I loaded this on the Trinket and at first I didn’t include a current limiting resistor and the LED showed a slight flicker, but not anything like a flickering tea light! After adding the current limiting resistor (220Ω)and that didn’t really change much except for dim the LED ever so slightly. So obviously I needed to tweak the code and see what I end up with..

Now my first thoughts on why it didn’t work out as expected is that the code was obviously written for a 5v logic, however this trinket is 3.3v logic. I made the following changes (after a little fiddling)and got more of what I was after 🙂