From what I have seen a scale will be read as 24bits ones compliment
therefore having 23bits of data plus a sign bit. It will typically have
a raw unit of measurement of 1/20480 of an inch. Having read the raw
value it would be displayed in inches by multiplying by 125/256 and for
millimetres by 127/1024. As the bit value equates to a probably very
noisy 0.000048828" it makes sense to lose some of the lower bits.
I intend having a play with some hardware and software.
Richard
toggle quoted message
Show quoted text
On 29/11/2019 22:53, BuffaloJohn wrote:
Interesting to look at where all this came from, I found you code
matches another I found, and there were lots of other references.
It seems that your calipers use the chinese protocol. That protocol
does not have a bit that indicates units as far as I can tell from the
other sources, so unless you see something in the bits above the sign
bit, you would be better off picking mm or inches and doing the math.
If, per chance. you find something in the bits above the sign, and you
see that one of those bits change when you change units, you have
found the units bit.
Remember, most of these devices have +/- 0.001" accuracy. Some of the
calipers I found have 0.001" (0.025mm) listed, some say 0.001"
(0.03mm). In any case, the calipers are not accurate to LSB of the
readout, so a numeric conversion of units is fine:
Resolution
0.01mm = 0.00039"
0.0005" = 0.0127mm
Accuracy
accuracy 0.001" = 0.0254mm
Buffalo John
On Fri, Nov 29, 2019 at 11:22 AM Chuck Pickering <chunk07@...
<mailto:chunk07@...>> wrote:
I can't seem to get the two sketches combined to read the units
bit and calculate the measurement based on that bit. Here is the
two sketches that work, one for mm, one for in. Both depend on the
mm/in switch be set to the measurement unit you want displayed. Am
I missing something thinking I can do this? The only difference in
the two sketches is how it converts the data to inch or mm. I
think I might need to input the value of the units bit instead of
reading it from the data.