pour bastos

Dependencies:   mbed

main.cpp

Committer:
vermaelen
Date:
2022-04-06
Revision:
0:e2ce7aa2a4a4

File content as of revision 0:e2ce7aa2a4a4:

#include "mbed.h"
#include "lib.h"

void fct()
{
    if(cPosD==0)cPosD=220;
    else cPosD=0;
    if(cPosG==0)cPosG=220;
    else cPosG=0;
}
void aff2(){
    printf("cPosG=%d -- cptG=%d -- cmdG=%d -- cPos=%.2f\n\r",cPosG,cptG,cmdG,cPos);
    }
int main()
{
    init();
//tac.attach(&aff2,0.5);
    while(1) {
        //printf("erD=%d -- somErD=%d -- cptD=%d -- cmd=%d\n\r",erD,somErD,cptD,cmdD);
        printf("Go !!\n\r");
        
        distance(2000);
        
        rotation(180);
        distance(1000);
        rotation(360);
        distance(1000);
        rotation(-180);
        
        wait(2);

    }
}