My chip brings me power consumption value.
It has a calibrated value Y (3 hexa bytes), that represents X WAT, and each time it sends me a value Z (3 hexa bytes)
Meaning, when i recieve Y from the Chip, i know that the power consumption is X WAT.
And when i receive Z from the chip, i know that the power consumption is
Z / Y * X.
The problem with Z / Y * X is that when i read the result of it in hexa, i'm getting an integer, and therefore losing accuracy.
All numbers i read are in hexa, meaning i cant receive a number in decimal (double type).
How can I be more accurate?
Thank you!
It has a calibrated value Y (3 hexa bytes), that represents X WAT, and each time it sends me a value Z (3 hexa bytes)
Meaning, when i recieve Y from the Chip, i know that the power consumption is X WAT.
And when i receive Z from the chip, i know that the power consumption is
Z / Y * X.
The problem with Z / Y * X is that when i read the result of it in hexa, i'm getting an integer, and therefore losing accuracy.
All numbers i read are in hexa, meaning i cant receive a number in decimal (double type).
How can I be more accurate?
Thank you!
Last edited: