jlñkjfasña

Dependencies:   mbed TextLCD max6675

Revision:
0:9f27b8759b12
diff -r 000000000000 -r 9f27b8759b12 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 03 12:03:54 2021 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+#include "max6675.h"
+#include "rtos.h"
+#include "TextLCD.h"
+
+I2C i2c_lcd(D7,D6);
+TextLCD_I2C lcd(&i2c_lcd, 0x4E,  TextLCD::LCD16x2, TextLCD::HD44780);
+max6675 sensor(D12,D13,D5);
+Serial pc(USBTX,USBRX);
+Thread thread;
+
+Thread thread2;
+Thread thread3;
+
+
+void pantallalcd()
+{
+    lcd.setMode(TextLCD::DispOn);
+    lcd.setBacklight(TextLCD::LightOn);
+    lcd.setCursor(TextLCD::CurOff_BlkOff);
+}
+
+void temp_hora()
+{
+    int cf = 1;
+    while (1) {
+       
+        float temp = sensor.gettemp(cf);
+        lcd.locate(0,0);
+        lcd.printf("temp:%1.2f",temp);
+        Thread::wait(1000);
+    }
+}
+
+
+int main()
+{
+    thread2.start ((temp_hora));
+    thread3.start((pantallalcd));
+    thread.join();
+    
+}