Arduino Oddity — Pulse Width Modulation (PWM) on Only Certain Ports
UPDATE II: Edited links to Makezine’s protoshield and TodBot’s candle light code.
UPDATE: I’m an idiot. Once I removed the protoshield, I saw that the board has clearly marked these pins as PWM! D’oh! I guess I got too comfortable using the shield and never bothered to actually look at the Diecimila itself.
Hmmm… I was modifying Todbot’s candlelight effect code to use multiple LEDs, but it seems that only certain ports on the Arduino allow such (3, 5, 6, 9, 10, and 11); the others merely flash on/off. The whole point of the code is to illuminate the LED in varying brightness such that it looks like a flickering candle.
I’m using this particular prototyping shield (others can be found here, here, here, or here) and ran the tests again on the bare Arduino, but found nothing wrong with the shield. I need to research this to find out why. I’ll update this post when I discover the reason.