test code to log ldr value

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ganesh70508
Date:
Thu Jan 05 11:00:59 2017 +0000
Commit message:
initial;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r e2162e735bfe main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jan 05 11:00:59 2017 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+AnalogIn ldr(PTB1);
+Serial pc(USBTX, USBRX); // tx, rx
+int main() {
+    unsigned int value;
+    while(1) {
+        if(pc.readable()) {
+            if (pc.getc() == 'A')
+                value = ldr*100.0;
+                pc.printf("%2d\n",value);
+        }
+        wait(0.01);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r e2162e735bfe mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 05 11:00:59 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e
\ No newline at end of file