Im a Student in Austria and im seachring the Internet to maybe get some help with my problem. So my part of this thesis is realy accuarte positioning. I got a very high end device sponsored by a company everything is working fine i get the data strings i want but there is so much extra information wich i dont need and so i try to connect my device to an arduino filter out only the good stuff and send that to an ipc. or maybe direktly to an ipc. so my question would be how can i filter out only specific types of data out of a string, The picture below shows what the string is looking like. its in ASCII and i only need the nubers before the N and the E (for North and East)..
strtok() is your friend. It can easily parse that simple format, and you should be able to find numerous examples of parsing exactly that format with Google.
RayLivingston:
strtok() is your friend. It can easily parse that simple format, and you should be able to find numerous examples of parsing exactly that format with Google.
Thanks but the data string isnt a static value i get them via usb and they get refreshed every 0.5sek. Maybe i can fix the time thing with a for loop but i dont know how to implement where the data srting is coming from in the code
machtbeule:
Thanks but the data string isnt a static value i get them via usb and they get refreshed every 0.5sek. Maybe i can fix the time thing with a for loop but i dont know how to implement where the data srting is coming from in the code
What is the device that is producing NMEA sentences of the form shown ?
$GNGNS
$GPGNS
$GLGNS
I can see that TinyGPS has been suggested but that as published only recognises these standard format NMEA sentences;
$GPRMC
$GPGGA
$GNRMC
$GNGGA
Modifying the library to read the start of the sentences from your device (what ever it is) looks possible, but you would need to check the detailed make up of what follows the $GNGNS, $GPGNS and $GLGNS.
TinyGPS is expecting a standard make up GxGGA and GxRMC NMEA sentences but the make up of the 'NMEA' from your device looks completly different.
So knowing what the device actually is and the exact format of its output data is needed.
A: Procedures: 1. Detect the pattern "$GNGNS," 2. Read and save characters until first ',' is encountered, Use atof() function to get the first floating point number. 3. Repeat Step-2 to extract the other two float numbers. 4. Accuracy of the float numbers could be different due to UNO/NANO which gives only 5-digit accuracy.
B: Example receiver sketch for the above steps: (tested on UNO-TX_Simulator and NANO-RX)
this question was answered here in the last couple of days. the correct answer was to tell the GPS not to send any string but the string you need. you would need the datasheet for your GPS to determine how you do that.