comunicacion bluetooth Sergio Burbano Daniel Paez Alejandro Pardo

Dependencies:   Servo SoftSerial mbed

main.cpp

Committer:
grupo3
Date:
2017-09-30
Revision:
0:d647d9d7d942

File content as of revision 0:d647d9d7d942:

#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]);
        

    
    
            }   

        }
    }