Harish Mekali / Mbed 2 deprecated UART1-M0

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
HarishMekali
Date:
Tue Dec 03 15:23:16 2013 +0000
Commit message:
uart

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 cf9ad81599d3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Dec 03 15:23:16 2013 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+Serial uart(p9, p10);
+ 
+BusOut leds(LED1, LED2, LED3, LED4);
+
+int a=0xff,z=0;
+
+int main() 
+{
+    while(1) 
+        {
+            
+            //uart.putc('a');
+            //uart.printf("Hi BMS");
+            //uart.puts("Hello");
+            //uart_activity = !uart_activity;
+            if(z==0)
+            {
+            z=z+1;
+            leds=a; 
+            wait(2);
+            a=0;
+            uart.printf("%d",a);
+            }
+            
+            if(uart.readable()) 
+            {
+            a=(int)uart.getc();
+            a=a+1;
+            uart.printf("%d",a);
+            leds=a;
+            wait(1); 
+            }
+            
+        }
+}
\ No newline at end of file
diff -r 000000000000 -r cf9ad81599d3 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Dec 03 15:23:16 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file