I'm trying to see how dim I can make an LED and still see it. I think it's related to the resolution of the digital I/O (pins 0-13 on the Uno). I'm using the Blinking LED sketch and changing the values of delay for the on and off times.
If I use decimals for the delay values, how many places are significant? I think it only works with the first decimal place but I'm not even sure that it's not rounding up to the first whole number.
The values placed in the delay default to milliseconds. I think this is a function of the processor resolution, am I right? It seems that it would need 10 bits of resolution (1028 values). Is there an Arduino that has more resolution?
rcadena:
I'm trying to see how dim I can make an LED and still see it. I think it's related to the resolution of the digital I/O (pins 0-13 on the Uno). I'm using the Blinking LED sketch and changing the values of delay for the on and off times.
You'll find it's very, very dim indeed.
A big problem with PWM controllers is that the step from 0 to 1 is usually too big.
rcadena:
If I use decimals for the delay values, how many places are significant? I think it only works with the first decimal place but I'm not even sure that it's not rounding up to the first whole number.
None. delay() is an integer function.
rcadena:
2. The values placed in the delay default to milliseconds. I think this is a function of the processor resolution, am I right?
No.
The processor has a 16MHz clock. Programmed correctly you can pulse a LED for 1/16000000 of a second.
(nb. This means not using digitalWrite(), delay(), or anything like that...)
rcadena:
It seems that it would need 10 bits of resolution (1028 values).
You need far more resolution than that. Even 16-bits isn't really enough if you want "dimmest possible" in a dark room.