Programa de movimientos para robot-playa

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
oscarvzfz
Date:
Wed Nov 05 04:20:04 2014 +0000
Commit message:
latas

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 Nov 05 04:20:04 2014 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+Serial RC(p13,p14);
+Serial PC(USBTX,USBRX);
+DigitalOut l(LED4);
+
+char com;
+
+void F(){RC.putc(95);RC.putc(223);}
+void I(){RC.putc(95);RC.putc(160);}
+void DL(){RC.putc(33);RC.putc(223);}
+void D(){RC.putc(1);RC.putc(255);}
+void S(){RC.putc(64);RC.putc(192);}
+
+int main() 
+{ 
+    while(1)
+    {
+
+       
+        if (PC.readable())
+        {
+            com=PC.getc();
+
+            if(com=='a')//FRENTE
+            {F();l=0;}
+            
+            if(com=='n')//DERECHA L
+            {DL();l=0;}
+            
+            if(com=='d')//DERECHA R
+            {D();l=0;}
+            
+            if(com=='z')//IZQUIERDA L
+            {I();l=0;}
+            
+            if(com=='s')//STOP
+            {S();l=0;}
+            
+            if(com=='l')//Stop Lata
+            {S();l=1;}
+        } 
+    } 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 05 04:20:04 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file