Hey everyone.
I am having trouble saving Data from my GPS UP501 device. I've connected it to a PC and using Hyperterminal I get the following information:
$GPGSV,3,1,12,16,70,191,,06,66,044,24,23,63,265,29,27,59,026,3475
$GPGSV,3,2,12,03,55,358,39,13,36,226,17,19,27,355,33,31,24,081,78
$GPGSV,3,3,12,20,08,308,30,21,05,113,,07,04,241,,32,03,343,1678
$GPRMC,073829.000,A,3411.4320,S,01826.2891,E,0.40,16.38,040214,,,A42
$GPGGA,073830.000,3411.4322,S,01826.2891,E,1,7,1.55,39.6,M,32.5,M,,7F
$GPGSA,A,3,03,20,06,27,19,23,13,,,,,,1.81,1.55,0.940F
The one in red is what I am interested in...
#include <SoftwareSerial.h>
String buffer = ""; //clear buffer register
boolean serialFlag = 0; //clear my own flag
//SoftwareSerial mySerial(10, 11); // RX, TX ... the 10 is what matters based on my suggested wiring above
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(56700); //used for printing values to Serial monitor
Serial1.begin(9600); //GPS usit attached here
Serial.println("Start");
// set the data rate for the SoftwareSerial port
//mySerial.begin(9600);
}
void loop() // run over and over
{
if (Serial1.available()){ //if there is anything on Serial1 go into loop
if (Serial1.read() == '
Here is my code. I am looking at everything coming in and when it is a "$" the code must save all the following information into the String register named "buffer" until a * is received.
Now for the actual problem...
when I run the code it just ignores everything coming in, it just doesn't recognize the "$" symbol. Must I save it in another format or what exactly is going on here..
Please help){ //if it is a $ symbol (beginning of data message) continue
serialFlag = 1; //set flag high, allowing data to be saved
}
if (serialFlag == 1){ //if flag is high continue
buffer += Serial1.read(); //save all values into register called buffer
}
if (Serial1.read() == '*'){ //if * is read (end of message) continue
serialFlag = 0; //clear the flag (don't save anymore to the register named buffer
Serial.print(buffer); //print everything that is in the register named buffer
}
}
}
Here is my code. I am looking at everything coming in and when it is a "$" the code must save all the following information into the String register named "buffer" until a * is received.
Now for the actual problem...
when I run the code it just ignores everything coming in, it just doesn't recognize the "$" symbol. Must I save it in another format or what exactly is going on here..
Please help