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.
Dependencies: 4DGL-uLCD-SE MAX31855 mbed-rtos mbed
Fork of Thermo_MAX31855 by
Diff: main.cpp
- Revision:
- 2:0525f2f1dd95
- Parent:
- 1:04f483a4edc0
--- a/main.cpp Tue Oct 21 21:04:21 2014 +0000
+++ b/main.cpp Wed Oct 22 16:22:13 2014 +0000
@@ -31,7 +31,7 @@
four_slots.wait();
//lcd_mutex.lock();
uLCD.color(0xFFFF00);
- uLCD.locate(0,1); //col,row
+ uLCD.locate(0,0); //col,row
wait(0.1);
uLCD.printf("ET: %2d:%2d:%2d", h,m,s);
//lcd_mutex.unlock();
@@ -46,15 +46,20 @@
void thermoread(void const *args) { //line 2
float ftemperature = 0; // float variable for temperature
+ float ctemperature = 0; // float variable for temperature
while(true){
if (max1.ready()==1){
- ftemperature = max1.read_temp(); //Get the reading
-
+ ctemperature = max1.read_temp(); //Get the reading
+ ftemperature = (ctemperature)*(9.0/5.0)+32.0;
four_slots.wait();
uLCD.color(0xFFFF00);
- uLCD.locate(0,3); //col,row
+ uLCD.locate(0,2); //col,row
wait(0.1);
- uLCD.printf("Temp. is: %4.2f", ftemperature);
+ uLCD.printf("Temp. F: %4.2f", ftemperature);
+ uLCD.color(0xFFFF00);
+ uLCD.locate(0,4); //col,row
+ wait(0.1);
+ uLCD.printf("Temp. C: %4.2f", ctemperature);
four_slots.release();
}

MAX31855