comunicacion bluetooth Sergio Burbano Daniel Paez Alejandro Pardo

Dependencies:   Servo SoftSerial mbed

Revision:
0:d647d9d7d942
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Sep 30 21:15:24 2017 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include "SoftSerial.h"
+#include "Servo.h"
+
+Servo myservo(D7);
+Serial pc(USBTX,USBRX);
+SoftSerial bt(D2,D3);
+PwmOut motor(D8);
+int main()
+{
+    int cord[4]={};
+
+pc.printf("hola mundo\r\n");
+char recive;
+while(1)
+{
+
+    if (bt.readable()>0) {
+        for(int i=0; i<2; i++) {
+
+            recive=bt.getc();
+            cord[i]=recive;
+            myservo = recive*0.05263;
+            }
+         myservo = cord[0]*0.052;
+        motor=cord[1]*0.05263;
+        pc.printf("cordenada x:%D\n\r",cord[0]);
+
+        pc.printf("cordenada y:%D\n\r",cord[1]);
+        
+
+    
+    
+            }   
+
+        }
+    }
+    
\ No newline at end of file