Polybot Grenoble / Mbed 2 deprecated CDF2019

Dependencies:   mbed

main.cpp

Committer:
CharlesBl
Date:
2019-01-24
Revision:
5:5d767f9355e2
Parent:
4:4329f61a927e
Child:
6:e20ec9f212ea

File content as of revision 5:5d767f9355e2:

#include "mbed.h"
#include "defines.h"
#include "moteur.h"

UARTSerial controlleur(D10,D2,115200);
Serial pc(SERIAL_TX, SERIAL_RX);

int main(){   
    while(1){        
        for(int i=0; i<15; i++) {
            command(drive_forward_M1 ,i);
            command(drive_forward_M2 ,i);
            wait_ms(100);
        }
        for(int i=15; i>0; i--) {
            command(drive_forward_M1 ,i);
            command(drive_forward_M2 ,i);
            wait_ms(100);
        }
        
        for(int i=0; i<15; i++) {
            command(drive_backwards_M1 ,i);
            command(drive_backwards_M2 ,i);
            wait_ms(100);
        }
        for(int i=15; i>0; i--) {
            command(drive_backwards_M1 ,i);
            command(drive_backwards_M2 ,i);
            wait_ms(100);
        }
    }
}