pepe

Dependencies:   mbed Matrix

main.cpp

Committer:
FJMS
Date:
2019-11-24
Revision:
2:06b7789c7da0
Parent:
1:2716ea33958b

File content as of revision 2:06b7789c7da0:

#include "mbed.h"
#include "Robot.h"
#include "Communication.h"

//Serial pc(SERIAL_TX, SERIAL_RX);
InterruptIn button(USER_BUTTON);

volatile bool mode=true;
float x1=20,y1=20;          // Posição inicial do robo
float a1=0,b1=-1,c1=65;       // Reta ax + by + c = 0
float x2=65,y2=60,phi2=-pi/2; // Pose arbitrária

int p[2] = {59, 43};
int p1[2] = {70, 17};
int p2[2] = {20, 46};
int p3[2] = {48, 66};
//int p4[2] = {200,200};

void pressed()
{
    mode = !mode;
}

int main()
{
    //pc.baud(9600);
    button.fall(&pressed);
    setSpeeds(0,0);
    //wait(0.2);
    mapa(80,80);
    //cria_obj(117,84,p);
    //cria_obj(20,30,p1);
   // cria_obj(28,13,p2);
    //cria_obj(25,12,p3);

    //int_map(80, 80);
    while(1) {
        if (mode==true) {
            setSpeeds(0,0);

        } 
        else {
            setSpeeds(0,0); 
            
            motion();
            wait(1);
            
            VFF();
            //mode = true;
        }
    }
}