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.
main.cpp
00001 #include "mbed.h" 00002 00003 #include "TMP102.h" 00004 00005 #define LF "\r\n" 00006 00007 Serial pc(USBTX, USBRX); // tx, rx to PC 00008 00009 TMP102 temperature(p9, p10, 0x90); //A0 pin is connected to ground 00010 00011 int main() 00012 { 00013 pc.printf("TMP102 logger ready. Press 'u' to see the temperature." LF); 00014 00015 while(1) { 00016 //whenever the computer sends a 'u', give it the current temperature. 00017 char c = pc.getc(); 00018 if (c == 'u') { 00019 pc.printf("%f" LF, temperature.read()); 00020 } 00021 wait(1); 00022 } 00023 return 0; 00024 }
Generated on Tue Jul 12 2022 19:02:26 by
1.7.2