ER GS / Mbed 2 deprecated COMUNICACION_SERIAL

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
rgsbuap
Date:
Fri Oct 04 16:19:02 2019 +0000
Parent:
25:90e7333db6a7
Commit message:
Comunicacion serial (Ejemplo basico)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 01 18:17:17 2019 +0000
+++ b/main.cpp	Fri Oct 04 16:19:02 2019 +0000
@@ -1,12 +1,18 @@
 #include "mbed.h"
 
-DigitalOut foquito2(LED_BLUE);
+
+//Serial port (UART) configuration
+Serial pc(USBTX,USBRX);
 
-int main() {
-    while(1) {
-        foquito2 = 1;
-        wait(5);
-        foquito2 = 0;
-        wait(5);
+ int main()
+{
+  int8_t x=0;
+  pc.printf("El tamano en bytes de int8_t es: %d \r\n",sizeof(int8_t));
+  
+    while(1)
+    {      wait(0.2);
+pc.printf("El valor de x es: %d \r\n",x);   
+x = x+1;
     }
+  
 }