I've looked over the GPS example where it is using the RAW data, but I am building something that would make better use of the "Smart Mode." Right now all I am trying to do is read from the GPS to see if the data is valid. From my reading what needs to be done to get that data is send:
!GPS followed by a byte of data containing the equivalent of a 1 in decimal.
This is straight from the manual:
To send a command to the GPS Receiver Module, the user must first send the header string, which is “!GPS” without the quotes, followed by the specific command byte of their choice.
Each command consists of a single byte in hexadecimal. Depending on the command, a specific number of data bytes will be returned.
and here is the command I am using:
Cmd Constant Description Returned Bytes Variables (1 Byte Each Unless Noted)
0x01 | GetValid | Check validity of data string | 1 | 0 = Not Valid, 1 = Valid
Here is the code I am trying to use:
int incomingByte = 0;
void setup() {
Serial.begin(4800);
}
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.println(incomingByte);
Serial.flush();
}
Serial.print("!GPS");
Serial.write(1);
}
I have both the TX and RX pins on the Arduino (Duemilanove) connected to the SIO port on the Parallax GPS Receiver.
Here is an example of the output I am getting right now:
!GPS
71
!GPS
80
!GPS
83
!GPS
1
!GPS
51
!GPS
51
!GPS
13
!GPS
10
!GPS
33
!GPS
71
!GPS
80
!GPS
83
!GPS
1
!GPS
55
!GPS
49
!GPS
13
!GPS
10
!GPS
33
!GPS
71
!GPS
80
!GPS
83
!GPS
1
!GPS
56
!GPS
48
!GPS
13
!GPS
10
!GPS
33
!GPS
71
!GPS
80
!GPS
83
.
.
.
As you can see from the manual clipping above, that command should only return a single byte of data... however, it seems to continuously send data once I issue the command. If I take out the last 2 lines of code the GPS does not send any data whatsoever.
Anyone have any ideas?