Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MAX30205_Human_Body_Temperature_Sensor
Diff: MAX30205.cpp
- Revision:
- 2:a659724f496a
- Parent:
- 1:d4271ef9f37f
- Child:
- 4:68e1b36becb0
--- a/MAX30205.cpp Thu Apr 06 00:05:03 2017 +0000
+++ b/MAX30205.cpp Fri Apr 07 15:42:49 2017 +0000
@@ -121,12 +121,15 @@
//******************************************************************************
float MAX30205::toCelsius(uint32_t rawTemp)
{
- float val1, val2;
+ uint8_t val1, val2;
+ float result;
- val1 = static_cast<float>(rawTemp >> 8);
- val2 = static_cast<float>(rawTemp & 0xFF);
+ val1 = (rawTemp >> 8);
+ val2 = (rawTemp & 0xFF);
- return(val2 + (val1 / 256.0F));
+ result = static_cast<float>(val1 + (val2/ 256.0F));
+
+ return result;
}