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.
Diff: main.cpp
- Revision:
- 0:4cb63470a757
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed May 25 10:06:42 2011 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+#include "TMP102.h"
+
+#define LF "\r\n"
+
+Serial pc(USBTX, USBRX); // tx, rx to PC
+
+TMP102 temperature(p9, p10, 0x90); //A0 pin is connected to ground
+
+int main()
+{
+ pc.printf("TMP102 logger ready. Press 'u' to see the temperature." LF);
+
+ while(1) {
+ //whenever the computer sends a 'u', give it the current temperature.
+ char c = pc.getc();
+ if (c == 'u') {
+ pc.printf("%f" LF, temperature.read());
+ }
+ wait(1);
+ }
+ return 0;
+}