Yoann Seiller / Mbed 2 deprecated Test_UART

Dependencies:   mbed

Revision:
0:56723d925d39
Child:
1:e3bea6b4ce47
diff -r 000000000000 -r 56723d925d39 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 02 11:08:24 2021 +0000
@@ -0,0 +1,37 @@
+/*-----------------------------------------------------------------------
+Before to use this example, ensure that you an hyperterminal installed on your computer. 
+More info here: https://developer.mbed.org/handbook/Terminals
+The default serial comm port uses the SERIAL_TX and SERIAL_RX pins (see their definition in the PinNames.h file).
+The default serial configuration in this case is 9600 bauds, 8-bit data, no parity. 
+If you want to change the baudrate for example, you have to redeclare the
+serial object in your code:
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+
+Then, you can modify the baudrate and print like this:
+
+pc.baud(115200);
+pc.printf("Hello World !\n");
+-------------------------------------------------------------------------*/
+#include "mbed.h"
+Serial pc(PG_14,PG_9);        // Déclaration d’un objet de type Serial 
+
+
+
+int main() { 
+//char c ;      // Variable ou ranger un caractère 
+int i=0;
+  
+pc.printf("\nTest liaison serie PC-Carte Nucleo\n"); 
+pc.printf("Appuyer sur une touche du clavier \n"); 
+
+while(1) { 
+    wait(1);
+    i++;
+    printf("i = %d \n",i);
+    pc.putc(i);
+    if (i == 255){
+        i=0;}
+    
+    }
+}
\ No newline at end of file