Nucleo_printf

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
anoney180133
Date:
Fri Dec 11 14:14:18 2015 +0000
Commit message:
1

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 eb4797d75974 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 11 14:14:18 2015 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+//------------------------------------
+// Hyperterminal configuration
+// 115200 bauds(Default 9600), 8-bit data, no parity
+//------------------------------------
+/* No need Serial to UART just usb debugger. */
+
+Serial UART(SERIAL_TX, SERIAL_RX); // TX PA_2 , RX PA_3
+
+DigitalOut LED(D13,0);
+DigitalOut LED_debug(D7,0);
+
+
+void UARTIrq();
+
+ 
+int main() 
+{
+  unsigned int i = 0;
+  UART.baud(115200); // Set BuadRate
+  UART.attach(UARTIrq,Serial::RxIrq);
+  printf("Hello World !\r\n");
+  while(1) 
+  { 
+      wait(1);
+      printf("This program runs since %d seconds.\r\n", i++);
+  }
+}
+ 
+ void UARTIrq()
+{
+    char input_char = UART.getc();
+    LED_debug  = !LED_debug ;
+    if(input_char == '1')
+    {
+       LED = 1; 
+    }
+    else if(input_char == '0')
+    {
+      LED= 0; 
+    }
+      
+}
\ No newline at end of file
diff -r 000000000000 -r eb4797d75974 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Dec 11 14:14:18 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68
\ No newline at end of file