configuration du GPS via le Mbed

Dependencies:   mbed

main.cpp

Committer:
belloula
Date:
2012-03-06
Revision:
0:56f6f307dbb2

File content as of revision 0:56f6f307dbb2:

#include "mbed.h"
//Connect IMU to pc via Xbee to calibrate IMU via "AHRSInterfacex86" soft

Serial pc(USBTX, USBRX);
DigitalOut myled(LED1);

DigitalOut EnableGPS(p12);
Serial gps(p13, p14);

void fpc() {
    while (pc.readable()) {
        gps.putc(pc.getc());
    }
}

void fgps() {
    while (gps.readable()) {
        pc.putc(gps.getc());
    }
}

int main() {
    pc.baud(38400);
    gps.baud(38400);

    gps.attach(fgps);
    pc.attach(fpc);
    //reset xbee module
    EnableGPS=0;
    wait(1);
    EnableGPS=1;


    while (1)

    {
        myled = 0;
        wait_ms(500);
        myled = 1;
        wait_ms(500);
    }
}