Hi, I what I am trying to do is receive and store NMEA data. This is what is being sent into my Arduino:
$GNRMC,054934.00,A,3955.84845,N,11627.14239,E,0.706,183.80,280815,,,A7B
$GNVTG,183.80,T,,M,0.706,N,1.307,K,A25
$GNGGA,054934.00,3955.84845,N,11627.14239,E,1,09,1.54,109.0,M,-8.3,M,,5B
$GNGSA,A,3,17,28,03,06,11,24,,,,,,,2.70,1.54,2.2214
$GNGSA,A,3,86,87,77,,,,,,,,,,2.70,1.54,2.221A
$GPGSV,3,1,12,01,24,054,08,02,05,245,19,03,48,074,29,06,37,249,1978
$GPGSV,3,2,12,11,14,072,23,17,67,335,41,23,03,111,17,24,09,309,32*7C
$GPGSV,3,3,12,28,59,179,17,32,17,043,,42,38,146,,50,35,140,*7D
$GLGSV,3,1,10,70,23,038,,71,44,096,19,72,22,154,23,76,26,224,6F
$GLGSV,3,2,10,77,36,289,29,78,10,338,,85,12,080,22,86,51,038,366C
$GLGSV,3,3,10,87,40,308,42,88,01,280,69
$GNGLL,3955.84845,N,11627.14239,E,054934.00,A,A79
what I want to do is store the first line ($GNRMC) into a string, and then extract the numbers in the string to different floats. The number after the * is a checksum, which is to be stored in a byte. Then I can calculate the checksum and see if it matches the checksum in the message, and I can use the coordinate data.
the code I am now running is this:
char data[80];
int a = 0;
void setup() {
Serial1.begin(9600);
Serial.begin(9600);
}
void loop() {
if (Serial1.available()) {
Serial1.readBytesUntil('*', data, 80);
Serial.println(data);
}
}
and this is what I'm getting on the serial port monitor:
$GNRMC,055749.00,V,,,,,,,280815,,,N,045,328,146,,50,35,40,25,108,27,24,08,30
6F
$GNVTG,,,,,,,,,N,V,,,,,,,280815,,,N,045,328,146,,50,35,40,25,108,27,24,08,30
2E
$GNGGA,055749.00,,,,,0,08,1.15,,,,,,045,328,146,,50,35,40,25,108,27,24,08,30
4F
$GNGSA,A,1,17,28,0.81,1.15,1.40,,,,,045,328,146,,50,35,40,25,108,27,24,08,30
19
$GNGSA,A,1,86,87,,,,,,,056,,02,08,247,,03,46,069,30,06,40,28,23,05,108,25,24
,08,305,32,A,1,86,87,,,,,,,056,,02,08,247,,03,46,069,30,06,40,28,23,05,108,25,24
7D
$GPGSV,3,3,12,28,54,179,23,32,14,041,,42,38,146,35,140,40,28,23,05,108,25,24
76
,10,77,35,283,20,78,12,335,20,85,09,083,,86,49,045,3540,40,28,23,05,108,25,24
68
$G,88,03,284,20,78,12,335,20,85,09,083,,86,49,045,3540,40,28,23,05,108,25,24
61
$GNGLL,,,,,055749.00,V,N5,20,85,09,083,,86,49,045,3540,40,28,23,05,108,25,24
5E
Thanks.