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.
Diff: Temperature.cpp
- Revision:
- 4:19878f73f3e3
- Parent:
- 3:7d5e3b2ed878
- Child:
- 5:8582a28cf944
--- a/Temperature.cpp Wed Jan 16 23:55:13 2019 +0000
+++ b/Temperature.cpp Thu Jan 17 00:12:40 2019 +0000
@@ -24,5 +24,12 @@
}
float readTemp(rawTemp) {
-
+ short rawTemp;
+ float temp;
+ char buff[2];
+ const int tempAddr = 0x90;
+ tempSensor.read(tempAddr, buff, 2);
+ rawTemp = (buff[0] <<8) + buff[1];
+ rawTemp = rawTemp >> 4;
+ temp = 0.0625 * rawTemp;
}
\ No newline at end of file
