use TMP102 with 2 line LCD HD44780
Dependencies: TextLCD mbed TMP102
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 #include "TMP102.h" 00004 float val; 00005 TMP102 temperature(p9, p10, 0x90); //A0 pin is connected to ground 00006 TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7 but could use 27,28,29,30 instead of 17,18,19,20 00007 int main() 00008 { 00009 while(1){ 00010 val=temperature.read(); 00011 printf("Temperature: %f\n", temperature.read()); 00012 //lcd.printf("%f \n",temperature.read()); 00013 lcd.printf("%f \n",val); 00014 00015 wait(0.5); 00016 } 00017 return 0; 00018 }
Generated on Mon Jul 25 2022 00:33:58 by 1.7.2