Abdelmalek BELLOULA
/
ConfigGPS
configuration du GPS via le Mbed
Revision 0:56f6f307dbb2, committed 2012-03-06
- Comitter:
- belloula
- Date:
- Tue Mar 06 11:02:35 2012 +0000
- Commit message:
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 56f6f307dbb2 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 06 11:02:35 2012 +0000 @@ -0,0 +1,42 @@ +#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); + } +} \ No newline at end of file
diff -r 000000000000 -r 56f6f307dbb2 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Mar 06 11:02:35 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912