Issues Testing GPS


hello all,

i have gps sensor-1 trying test larger project. want right see data in serial monitor make sure receiving properly. post code below, not think problem (granted new arduino language, , relatively new coding in general, modified code found on arduino website think it's right).

basically issue this: if plug nmea stream rx pin on arduino (and ground) , plug gps power, data gps lock indicator light not come on. if reverse order , power gps before plugging in nmea stream, gps indicator light come on, turn off 30 seconds after plugging in nmea stream (yet receive data entire time). unplug nmea stream, , gps light on again.

have of ever worked sensor-1 gps systems, or had similar issue? talked tech support, , while nice , trying best, best tell me "that's weird."

here's code:

code: [select]

int bytegps=-1;
int rxpin = 0;
void setup() {
 // put setup code here, run once:
pinmode(rxpin, input);
serial.begin(19200);
}

void loop() {
 // put main code here, run repeatedly:
bytegps=serial.read();        
  if (bytegps == -1) {          
    delay(100);
  } else {
   serial.println(bytegps);
   delay(100);
  }
}


thanks in advance

please modify post , put
[code]your code[/code]
 inside code tags so

code: [select]
...it looks
    like this.

what arduino using?

normally, can't hook gps tx arduino rx pin, because 1 used communicate on usb computer.  that's how new programs uploaded.

could hook gps pins 8 & 9 (assuminag uno) , use altsoftserial second serial port?  then can read altsoftserial , write serial simple "echo test":

code: [select]
#include <altsoftserial.h>

altsoftserial gps_port; // uses 8 & 9 on uno, different pins on other arduinos

void setup()
{
  serial.begin( 9600 ); // or whatever serial monitor window using
  gps_port.begin( 9600 ); // or whatever gps using...
}

void loop()
{
  if (gps_port.available())
    serial.write( gps_port.read() );
}

this proper way check received data.

cheers,
/dev


Arduino Forum > Using Arduino > Sensors > Issues Testing GPS


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'