[Ovmsdev] General issue: metric system ;-)

Mark Webb-Johnson mark at webb-johnson.net
Sat Nov 3 22:08:27 HKT 2012


Michael,

I think that the protocol requires Miles for this, and the Apps convert as necessary. From a precision point of view, it would be best to store it in the user's chosen units, but we do try to minimise what is done in the can bus interrupt service routines.

It is not so easy to change, but I'll see what is the best way. For the moment, best to leave it in miles?

Regards, Mark.

P.S.		Miles -> Kilometer formula is (((miles << 4)+5)/10))
		I am sure there is something equally efficient for kilometers -> miles
		Best to avoid using floating point - especially in the interrupt service routines

On 3 Nov, 2012, at 4:08 AM, Michael Balzer <dexter at expeedo.de> wrote:

> I hesitate to touch anything outside the can module yet, but I would like to store range values in kilometers.
> 
> Reason: my car uses km and I'm losing precision if converting them to integer (!) miles.
>    1 mi = 1.609 km
> 
> Are there any thoughts on this? Could it be just a labeling switch or does the server/app protocol need miles?
> 
> Regards,
> Michael
> 
> -- 
> Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
> Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
> 
> <dexter.vcf>_______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev




More information about the OvmsDev mailing list