gps
Dependencies: mbed
Revision 0:d0c5d19ca007, committed 2017-01-18
- Comitter:
- wallsow
- Date:
- Wed Jan 18 14:35:08 2017 +0000
- Commit message:
- gps;
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 d0c5d19ca007 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 18 14:35:08 2017 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" + +//serial config +Serial pc(PA_0,PA_1); //Serial class for transmission of serial data +//***Broche Connexion GPS ***********// +Serial GPSTXRX(PA_2,PA_3); // input PB_1 for X axis + +int main() +{ + pc.baud(9600); + pc.format(8,SerialBase::None,1); + //----------prinf test sur pc--------- + pc.printf("\r\n GPS Test program"); + pc.printf("\r\n******\r\n"); + //------------------------ + + + while(1) { + pc.printf("\r\n GPS Test en cours"); + pc.printf("\r\n******\r\n"); + + int i; + int tag[256]; + char buff[55]; + + + for(i=0;i<255;i++) + { + tag[i]=GPSTXRX.getc(); + pc.printf("gps:%d",tag[i]); + sprintf(buff,"%d%d%d%d%d",tag[0],tag[1],tag[2],tag[3],tag[4]); + pc.printf("%s \r\n",buff); + int code = atoi(buff); + pc.printf("%d \r\n",code); + } + + wait(10); + /* if(GPSTXRX.readable()) + { + serial.putc(GPSTXRX.getc()); + } + char c; + char buffer[128]; + + GPSTXRX.gets(buffer,8); + + serial.printf("I got '%s'\n", buffer); + wait(1);*/ + } +} \ No newline at end of file
diff -r 000000000000 -r d0c5d19ca007 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jan 18 14:35:08 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab \ No newline at end of file