5_Serial_communication

Dependencies:   mbed

Revision:
0:6bc1fd344c20
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 04 18:29:09 2013 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"              
+ 
+Serial pc(USBTX, USBRX); // tx, rx
+AnalogIn s1(p20); 
+
+int main()
+ {
+ float x;
+ while(1)
+ {
+ x=s1.read();
+ pc.printf("%f",x);
+ wait(1);
+    pc.printf("%f",x);
+ wait(1);
+}
+}
\ No newline at end of file