jlñkjfasña
Dependencies: mbed TextLCD max6675
main.cpp
- Committer:
- juanespitiarobotica
- Date:
- 2021-12-03
- Revision:
- 0:9f27b8759b12
File content as of revision 0:9f27b8759b12:
#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(); }