Just scale up by a factor of ten, then the least significant digit will be your tenths of an inch.
DISTANCE=(RAW*10)/15
so your example will have 900/15=60 now the tenths can be easily extracted with the DIG command.
Now if RAW is going to have a value greater than 6553, you'll have to use the DIV32 command to divide by 15 (after first multiplying RAW by 10). With WORD variables your limit for DISTANCE will be 6553.5 which is way beyond what your Sensor can deliver anyhow.




Bookmarks