Washington, DC
Offline
Newbie
Karma: 0
Posts: 46
Changes are never trivial.
|
 |
« on: February 10, 2011, 05:45:10 pm » |
Dexter Industries Arduino GPS Shield http://dexterindustries.com/Arduino-GPS_Shield.htmlWe have had a few customers buy this on Amazon and through other vendors and we wanted to make sure the code was out there. The GPS shield uses Digital Pins 3 and 4 for serial communications with the GPS unit, freeing up the serial lines on Pins 0, 1 for communications with the computer. This makes debugging a lot easier. This requires some slightly different code than the typical GPS tutorial offers. So we've modified it here below. You can download the code from our website, but we thought we'd paste it here to make it easier to find: /*
Listen for the $GPRMC string and extract the GPS location data from this. Display the result in the Arduino's serial monitor. For use with the Dexter Industries GPS Shield. This code was a modification of code found on the Arduino website. SoftwareSerial Library: http://www.arduino.cc/en/Reference/SoftwareSerial GPS Tutorial: http://www.arduino.cc/playground/Tutorials/GPS */
#include <string.h> #include <ctype.h> #include <SoftwareSerial.h> // Software serial TX & RX Pins for the GPS module #define SoftrxPin 3 #define SofttxPin 4 // Initiate the software serial connection SoftwareSerial gpsSerial = SoftwareSerial(SoftrxPin, SofttxPin);
int ledPin = 13; // LED test pin int rxPin = 0; // RX PIN int txPin = 1; // TX TX int byteGPS=-1; char linea[300] = ""; char comandoGPR[7] = "$GPRMC"; int cont=0; int bien=0; int conta=0; int indices[13];
void setup() { pinMode(ledPin, OUTPUT); // Initialize LED pin pinMode(rxPin, INPUT); pinMode(txPin, OUTPUT); Serial.begin(9600); gpsSerial.begin(9600); //start serial for communication with GPS for (int i=0;i<300;i++){ // Initialize a buffer for received data linea=' '; } }
void loop() { //delay(1000); digitalWrite(ledPin, HIGH); byteGPS=gpsSerial.read(); //read a byte from the serial port if (byteGPS == -1) { // See if the port is empty yet delay(100); } else { linea[conta]=byteGPS; // If there is serial port data, it is put in the buffer conta++; Serial.print(byteGPS, BYTE); if (byteGPS==13){ // If the received byte is = to 13, end of transmission digitalWrite(ledPin, LOW); cont=0; bien=0; for (int i=1;i<7;i++){ // Verifies if the received command starts with $GPR if (linea==comandoGPR[i-1]){ bien++; } } if(bien==6){ // If yes, continue and process the data for (int i=0;i<300;i++){ if (linea==','){ // check for the position of the "," separator indices[cont]=i; cont++; } if (linea=='*'){ // ... and the "*" indices[12]=i; cont++; } } Serial.println(""); // ... and write to the serial port Serial.println(""); Serial.println("---------------"); for (int i=0;i<12;i++){ switch(i){ case 0 : Serial.print("Time in UTC (HhMmSs): "); break; case 1 : Serial.print("Status (A=OK,V=KO): "); break; case 2 : Serial.print("Latitude: "); break; case 3 : Serial.print("Direction (N/S): "); break; case 4 : Serial.print("Longitude: "); break; case 5 : Serial.print("Direction (E/W): "); break; case 6 : Serial.print("Velocity in knots: "); break; case 7 : Serial.print("Heading in degrees: "); break; case 8 : Serial.print("Date UTC (DdMmAa): "); break; case 9 : Serial.print("Magnetic degrees: "); break; case 10 : Serial.print("(E/W): "); break; case 11 : Serial.print("Mode: "); break; case 12 : Serial.print("Checksum: "); break; } for (int j=indices;j<(indices[i+1]-1);j++){ Serial.print(linea[j+1]); } Serial.println(""); } Serial.println("---------------"); delay(10000); } conta=0; // Reset the buffer for (int i=0;i<300;i++){ // linea=' '; } } } }
|
|
|
|
|
Logged
|
|
|
|
|
Reynosa, Mexico
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #1 on: November 01, 2011, 06:23:12 pm » |
Hello,
I'm new on Arduino and I want to start working with on a GPS project.
I would like to have the Arduino GPS and SMS (GPS) capable, also I would like it to record a log of coordinates as well as some other info as time in i.e. then it needs to be able to download the log to my PC using Bluetooth so I will build a route map on my PC track system (working in the development too).
What Arduino board and shields do you recommend me to buy for my prototype?
Thank in advance for your help.
Eduardo
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 2
|
 |
« Reply #2 on: March 21, 2012, 04:52:01 am » |
hello..im new in arduino..im using arduino mega 1280..im trying to display the longitude and the mag. at 20x4 lcd..btw,im using gps shield v1.0...need others connection between arduino board and gps shield?because i just stack them together...is lcd.print=serial print command?plssss help me,can someone provide me the coding...
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 314
Posts: 35518
Seattle, WA USA
|
 |
« Reply #3 on: March 21, 2012, 07:09:27 am » |
Mega 1280, LCD, GPS, and newbie are not 4 terms that belong in the same post. is lcd.print=serial print command? Depending on what class lcd is an instance of the print() method may actually come from the Print class. The Serial.print() method does come from the Print class. In that sense, they are the same. Where the data that gets printed goes to is quite different, so in that sense they are not the same. plssss help me Ok. That's spelled please. can someone provide me the coding... Coding for what? Which GPS do you have? On which pins/serial port? Which LCD do you have? On which pins? This is not a start from scratch project. This is a built it up as you add hardware project. Writing GPS data to the LCD is exactly the same as writing "Hello, world" to the LCD. If you can't get "Hello world" on the LCD. put the GPS back in the box, and put it away, until you can.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 2
|
 |
« Reply #4 on: March 22, 2012, 07:54:05 am » |
hello..sorry for my silly question and my broken English..ive no problem displaying hello world, i've trying to modified the coding from arduino tutorial...im using Charactor LCD Module (20 x 4 lines, LED Backlight) and GPS shield v1.0(MYD1094 model) with active antenna...i need the examples coding to display the gps data on the lcd..and how to communicate the GPS shield to my arduino..
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 314
Posts: 35518
Seattle, WA USA
|
 |
« Reply #5 on: March 22, 2012, 09:10:40 am » |
i've trying to modified the coding from arduino tutorial I'm pretty sure that there is more than one Arduino tutorial on the internet. Can you be just a teensy bit more specific? im using Charactor LCD Module (20 x 4 lines, LED Backlight) Which you can write to, so you know that it is connected correctly and is functioning. and GPS shield v1.0(MYD1094 model) with active antenna I've clicked all over your post. Nothing happens. The internet must be down. I'll try again later. i need the examples coding to display the gps data on the lcd lcd.print(gpsData); and how to communicate the GPS shield to my arduino As soon as the internet comes back up, or you post a link...
|
|
|
|
|
Logged
|
|
|
|
|
Grand Rapids Mi
Offline
Jr. Member
Karma: 0
Posts: 52
|
 |
« Reply #6 on: April 11, 2012, 07:52:25 am » |
Cool story bro, When i get my arduino im getting this!
|
|
|
|
|
Logged
|
|
|
|
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #9 on: September 20, 2012, 03:10:54 pm » |
Adafruit: The Ultimate GPS
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Washington, DC
Offline
Newbie
Karma: 0
Posts: 46
Changes are never trivial.
|
 |
« Reply #10 on: November 02, 2012, 08:07:43 am » |
We have updated the GPS shield to include Mega, Duo, and Leonardo. And a picture of our latest build! 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #11 on: November 02, 2012, 10:57:32 am » |
and what is the improvement of this version?
|
|
|
|
|
Logged
|
|
|
|
|
Washington, DC
Offline
Newbie
Karma: 0
Posts: 46
Changes are never trivial.
|
 |
« Reply #12 on: November 02, 2012, 11:53:27 am » |
One really big one: we've added solder jumpers on the bottom that let you use it with the Mega version of the Arduino. You can use these to use a different set of communication lines if you need the original lines for your project. If this sounds confusing, we have added the schematic and board drawings: http://dexterindustries.com/files/GPS_Shield_2.0.zipAnother one: the software and examples were updated for the latest Arduino 1.0.1. We added a few examples and additional calculations that let you calculate distances to destinations and times easier: http://dexterindustries.com/files/dGPS.zip
|
|
|
|
« Last Edit: November 02, 2012, 05:27:36 pm by Johnny D »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #13 on: November 02, 2012, 01:34:52 pm » |
hi both links point to the same zip file with .sch and .brd the link to the examples is missing.
BUT it's still incompatible with the 3.3V specification of the GPS receiver!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 248
Posts: 16535
Available for Design & Build services
|
 |
« Reply #14 on: November 02, 2012, 03:26:57 pm » |
How do you figure ursm?
■Input Voltage: 3.0V ~ 5.5V DC
|
|
|
|
|
Logged
|
|
|
|
|
|