Well, the fact that it only differs by a bit each time sounds good. It's a 24 bit number, so could give you anything up to 24 million. The fact it's 169k probably means it's basically unloaded.
I'd experiment by putting different stresses on it and seeing how it changes.
Also, 338642 / 2 = 169321 - so it seems like the digitalPulse code might be working too, although maybe you're reading one too many bits, which is pushing the value up. Personally I'd avoid digitalPulse though because the async-ness of it might make it less reliable. The SPI method is quite efficient too.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well, the fact that it only differs by a bit each time sounds good. It's a 24 bit number, so could give you anything up to 24 million. The fact it's 169k probably means it's basically unloaded.
I'd experiment by putting different stresses on it and seeing how it changes.
Also, 338642 / 2 = 169321 - so it seems like the digitalPulse code might be working too, although maybe you're reading one too many bits, which is pushing the value up. Personally I'd avoid digitalPulse though because the async-ness of it might make it less reliable. The SPI method is quite efficient too.