added spectrometer timeout
Dependencies: SDFileSystem mbed
Fork of All_Combined_Real2 by
Diff: temp_sensor.cpp
- Revision:
- 9:924d80730ac5
- Parent:
- 3:c611fff05072
- Child:
- 12:2df303e4aee2
--- a/temp_sensor.cpp Mon Apr 04 18:30:02 2016 +0000 +++ b/temp_sensor.cpp Mon Apr 11 18:32:28 2016 +0000 @@ -12,6 +12,7 @@ int tempval; volatile char TempCelsiusDisplay[] = "+abc.dd C"; +double tempCelsiusDouble; void init_temp_sensor() { @@ -77,6 +78,13 @@ TempCelsiusDisplay[1] = (tempval / 100) + 0x30; TempCelsiusDisplay[2] = ((tempval % 100) / 10) + 0x30; TempCelsiusDisplay[3] = ((tempval % 100) % 10) + 0x30; + + if (TempCelsiusDisplay[0] == '+') { + sscanf(TempCelsiusDisplay, "+%lf C", &tempCelsiusDouble); + } else { + // negative + sscanf(TempCelsiusDisplay, "%lf C", &tempCelsiusDouble); + } }