Maxim Integrated MAX30205 C, C++ source code driver software: MAX30205 is accurate to +-0.1°C over the range of 37.0°C to 39.0°C. One-shot, shutdown modes are available for reduced power usage. Thermostat thresholds allow for temperature hysteresis or for alarm settings. The MAX30205 is available in a compact 3x3 mm, 8-pin TDFN package. Operating supply voltage range is 2.7V to 3.3V. Typical applications are for clinical digital thermometers, thermostats with hysteresis, and temperature alarms.
Dependents: MAX30205_Human_Body_Temperature_Sensor
Revision 2:a659724f496a, committed 2017-04-07
- Comitter:
- j3
- Date:
- Fri Apr 07 15:42:49 2017 +0000
- Parent:
- 1:d4271ef9f37f
- Child:
- 3:939090042b32
- Commit message:
- fixed temperature fxs
Changed in this revision
| MAX30205.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
}