skgps53 and arduino mega

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

skgps53 and arduino mega

Postby sitimariam » Mon Mar 10, 2014 4:13 pm

hello,

I have try by using the tutorial that provided at cytron for skgps53 with arduino.
I tried a lot with the codes but my result shown below,

Latitude : 0.0000000 :: Longitude : 0.0000000
Latitude : 0.0000000 :: Longitude : 0.0000000
Latitude : 0.0000000 :: Longitude : 0.0000000

I have try at the outdoor for 3hours but still same result I get,

Latitude : 0.0000000 :: Longitude : 0.0000000
Latitude : 0.0000000 :: Longitude : 0.0000000
Latitude : 0.0000000 :: Longitude : 0.0000000

do you know what is the problem?
sitimariam
Newbie
 
Posts: 8
Joined: Mon Feb 24, 2014 11:24 am

Re: skgps53 and arduino mega

Postby ober » Tue Mar 11, 2014 7:58 am

Mind sharing the photo of hardware setup?

Besides, is the LED at G_TX blink?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: skgps53 and arduino mega

Postby sitimariam » Tue Mar 11, 2014 12:09 pm

this is the hardware setup..and the led of G-TX is blink when i connect with the laptop..
Attachments
IMG_20140311_120357.jpg
sitimariam
Newbie
 
Posts: 8
Joined: Mon Feb 24, 2014 11:24 am

Re: skgps53 and arduino mega

Postby ober » Tue Mar 11, 2014 12:50 pm

Which tutorial that you refer? Can you provide the link to the tutorial? Also can you share the code?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: skgps53 and arduino mega

Postby sitimariam » Tue Mar 11, 2014 1:07 pm

http://tutorial.cytron.com.my/2012/08/1 ... -skgps-53/

CODE: SELECT_ALL_CODE
#include <TinyGPS.h>
#include <SoftwareSerial.h>

unsigned long fix_age;

SoftwareSerial GPS(2,3);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;

void setup(){
 GPS.begin(9600);
 Serial.begin(115200);
}

void loop(){
long lat, lon;
unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;

// retrieves +/- lat/long in 100000ths of a degree
gps.get_position(&lat, &lon, &fix_age);

// time in hh:mm:ss, date in dd/mm/yy
/*gps.get_datetime(&date, &time, &fix_age);
year = date % 100;
month = (date / 100) % 100;
day = date / 10000;
hour = time / 1000000;
minute = (time / 10000) % 100;
second = (time / 100) % 100;
Serial.print("Date: ");
Serial.print(year); Serial.print("/");
Serial.print(month); Serial.print("/");
Serial.print(day);
Serial.print(" :: Time: ");
Serial.print(hour); Serial.print(":");
Serial.print(minute); Serial.print(":");
Serial.println(second);
*/
getGPS();
Serial.print("Latitude : ");
Serial.print(LAT/100000,7);
Serial.print(" :: Longitude : ");
Serial.println(LON/100000,7);
}

void getGPS(){
  bool newdata = false;
  unsigned long start = millis();
  // Every 1 seconds we print an update
  while (millis() - start < 1000)
  {
    if (feedgps ()){
      newdata = true;
    }
  }
  if (newdata)
  {
    gpsdump(gps);
  }
}

bool feedgps(){
  while (GPS.available())
  {
    if (gps.encode(GPS.read()))
      return true;
    }
    return 0;
}

void gpsdump(TinyGPS &gps)
{
  //byte month, day, hour, minute, second, hundredths;
  gps.get_position(&lat, &lon);
  LAT = lat;
  LON = lon;
  {
     feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors
  }
}
sitimariam
Newbie
 
Posts: 8
Joined: Mon Feb 24, 2014 11:24 am

Re: skgps53 and arduino mega

Postby ober » Tue Mar 11, 2014 2:15 pm

If you check software serial library, Arduino Mega cannot support software Serial for pin 2 or 3 for Rx. But you are using pin 2 and 3 as the UART pin.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: skgps53 and arduino mega

Postby sitimariam » Tue Mar 11, 2014 2:26 pm

owh..that means I need to change the pin for RX?
I have try the pin for RX to 5 and 6 still I got the same result..
sitimariam
Newbie
 
Posts: 8
Joined: Mon Feb 24, 2014 11:24 am

Re: skgps53 and arduino mega

Postby ober » Tue Mar 11, 2014 9:58 pm

Please do some study yourself to understand the softwareserial: http://arduino.cc/en/Reference/SoftwareSerial#.Ux8R2vmSwR8

It does not mean pin 2 and 3 cannot use, pin 5 and 6 can be used. :mrgreen:
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 9 guests

cron