is 20 milliseconds.
A dust mite fell on my 0 key and depressed it at the most inopportune time.
Would there be any advantage to doing one's own pulse-width modulation using software
That all makes sense. Thanks for clarifying how that works. I did not know it was just one big signal clumped together. Would there be any advantage to doing one's own pulse-width modulation using software, and doing a more sophisticated algorithm? Like for half voltage (in other words, for the value 128) doing every other bit high? Then perhaps one could use a low-pass filter with a higher threshold to smooth out the signal.
What I meant was this. Say you wanted an analog value of 128. That's a duty cycle of 50%. Currently the Arduino pulse-width modulation does that by doing HIGH 128 times followed by LOW 128 times. That's a frequency of 500 Hertz. If you did it instead by doing HIGH LOW 128 times, that's a frequency, I think, of 64 kHz. That's above the human hearing range. Also, that higher frequency is easier to filter, so you lose less of your 0 to 5 Volts range. That might help in my application. But mostly I'm just curious.
Currently the Arduino pulse-width modulation does that by doing HIGH 128 times followed by LOW 128 times. That's a frequency of 500 Hertz.
Thanks for the clarifications. I understand the Arduino pulse-width modulation better now. My preference would be to have less granularity -- maybe 25 steps instead of 255 -- and a higher frequency than the Arduino hardware pulse-width modulation provides. Now understanding this better, I'll see if I can figure out a way to do that.