PWM output problem

Hello everyone! Got a little problem. I am using pins 5,6,9,10 for PWM output. When I do analogWrite(pin, 0) to pin 9 and 10 I get close to 0 volts (.03v) like it should be. When I set pins 5 and 6 to value 0 I get .3 volts out of them which makes my test leds light up. Any ideas? Thanks!

try using a potentiometer as the value, see if when you turn it to the pot to its lowest point, the light turns off, from there you can further tell if you have a real problem or not...

as for actually hooking up the pot, find a tut, cuz im way too tired right now...sry

Hmm, I think I finally realized what's causing this. The timer that controls the PWM outputs on pins 5 and 6 is also used to do the timing for the millis() function. The extra overhead of the timer overflow interrupt (that increments the internal time counter) is probably preventing the output from going all the way low. This may be a tricky problem to solve (though I hope someone can point out a really easy solution that I'm missing).

Putting an ordinary diode in series with the LED wil create a voltagedrop of ca. 0.6V, which should prevent the LED from lighting up. This will of course also "eat" 0.6V from the PWM signal over the entire 0 - 5 V range, which might not be desirable.

EDIT: This is of course only a solution to the specific problem with the LED, not the genereal underlying problem.