PulseIn - again

The "width * 10" converts from "loops" to clock cycles. The clocksToMicroseconds() converts from clock cycles to microseconds and does the division by 16 or whatever clock rate you declared. (It got renamed since I wrote that, it will be clockCyclesToMicroseconds() by the time it comes out.)

Frustratingly, all though there are a number of clock sources available, the chip appear to only be able to see one for any given fuse configuration. I wanted to make a provision to automatically learn the crystal rate for the various timing conversion functions, but I can't figure out a way to watch one of the slower clocks to count my faster clock cycles.

The serial bootloader could be made to do it by watching the RS232 and performing an autobaud operation, but there isn't room for the code and then I'd have to define a spot in flash or eeprom to hold the result until the sketch was running which would be odd.

(Ok, there is a trick I could do with the watchdog timer to figure out the clock rate, but it seems extreme and is incompatible with people's current bootloader and fuse combinations.)