V2.0

Dependencies:   mbed

Revision:
0:c2333cdfbcfa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Oct 25 18:37:07 2017 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX, 9600); // tx, rx
+Serial device(p9, p10, 9600);  // tx, rx
+DigitalOut RTS(p7);
+DigitalIn CTS(p8);
+int flag=1; 
+
+int main() {
+    pc.printf("Inicio de Programa \n\r");
+    wait(.1);
+    pc.printf("El valor de CTS inicial es %d\n\r",CTS.read());
+    RTS=0;
+    while(flag==1){
+        flag=CTS.read();
+        wait(.1);
+        pc.printf("El valor de flag es %d\n\r", flag);
+        }
+        /*device.putc(0XAA);
+        device.putc(0X05);
+        device.putc(0X07);
+        device.putc(0X66);
+        device.putc(0XB0);*/
+        wait(.1);
+        RTS=1;
+        wait(.1);
+    while(1) {
+        pc.putc(device.getc());
+    }
+}
\ No newline at end of file