ElectronicCats / CayenneLPP

Library for Arduino compatible with Cayenne Low Power Payload

Home Page:http://electroniccats.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: "businesslike conduct" round to reduce data error from 0.09 to 0.05 (~50% accuracy enhancement)

g6094199 opened this issue · comments

hi,

we have seen some problems when it comes to rounding (in our case for temp measurements).

in the current code the float temp just gets cut after the 1st decimal place, which is very inaccurate!

uint32_t v = value * multiplier;

in this case the error is at worst 0.09. so almost 0.1° off.

instead the float temp should be businesslike conduct rounded (in germany we call this "Kaufmännisches Runden") before chopping off the last digit, like so:

uint32_t v = round(value * multiplier);

in this case the error is @ max. 0.05° off. which is much more accurate for professional use. of cause other values can benefit from this kind of correction, too.

commented

Hello @g6094199!

We appreciate you bringing this issue to our attention. Truly appreciated you have taken the time out of your day.
Could you please a pull request with the correction you are mentioning? I will communicate this to our Engineering Team to review your pull request and fix this as quickly as possible.

Have an amazing day!
Kind regards.

commented

This is a message to remind you that your request has been pending for 5 days and awaits your comments.
Our agent would like to hear from you about your previous request to see if the difficulty you were facing has been resolved or if we can provide further assistance. Otherwise, if we do not hear back from you within the next three days, the issue will be closed.
Kind regards, Electronic Cats Support Team

commented

for reference: #44 (comment)