hi, clinton
no difficulties...
suppose you won't count more than 1008 liters ( 65535 pulses ...); liters is a WORD !
1) calculate liters
liters = pulses/65 ... obvious
2) calculate decimals
Tmilliliters = ((pulses // 65) *10000)/65
centiliters = DIV32 100
here we take the pulses count remainder ( less than 1 liter ... ), multiply by 10000 and divide per 65 to get 1/10,000 liters; this number is an integer and respects the sensor conversion ratio.
then result is truncated to centiliters to keep a 0/ -1 digit ( or centiliter ) calculation precision ... and resolution.
Why centiliters ??? ... simply because sensor counts per 1.54 centiliter increment ... shown milliliters would only be virtual ... hence FALSE ! ( but our calculation is true !!!)
3 ) print result
Pulsout $FE,1 ,dec Liters,"." dec3 centiliters
here it is ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks