V2.0

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Sumobot
Date:
Wed Oct 25 18:37:07 2017 +0000
Commit message:
V2.0 comunicaci?n STX3

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
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 25 18:37:07 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file