gps.encode() always returning false
i've arduino duemilanove , radix up501 gps module.
i've connected tx of module pin 10 of arduino. vcc of module 5v of arduino , ground of module ground of arduino.
this code :
the problem gps.encode() returning false.
what problem. gps module derped ??
i've connected tx of module pin 10 of arduino. vcc of module 5v of arduino , ground of module ground of arduino.
this code :
quote
#include <tinygps.h>
/*
circuit:
* rx digital pin 10 (connect tx of other device)
* tx digital pin 11 (connect rx of other device) */
#include <softwareserial.h>
softwareserial myserial(10, 11); // rx, tx
tinygps gps;
unsigned long fix_age;
long lat, lon;
int c;
void setup()
{
// open serial communications , wait port open:
serial.begin(4800);
while (!serial) {
; // wait serial port connect. needed leonardo only
}
serial.println("goodnight moon!");
// set data rate softwareserial port
myserial.begin(4800);
}
void loop() // run on , over
{
if (myserial.available())
c = myserial.read();
if(gps.encode(c)){
serial.println("inside if condition");
gps.get_position(&lat, &lon, &fix_age);
serial.print("lat :");
serial.print(lat);
}
}
the problem gps.encode() returning false.
what problem. gps module derped ??
is gps connected myserial instance? if so, purpose of code:
are expecting gps reply that?
are sure myserial.available() ever returns non-zero value? if so, myserial.read() return?
code: [select]
myserial.println("hello, world?");
are expecting gps reply that?
are sure myserial.available() ever returns non-zero value? if so, myserial.read() return?
Arduino Forum > Using Arduino > Programming Questions > gps.encode() always returning false
arduino
Comments
Post a Comment