splash
Welcome
StevenJohal.com is a blog mostly about various forms of Engineering.
Posted By admin on March 23rd, 2010

The Issue
A little over a year back, I had over 200 pictures stored on Lexar Memory Stick Pro Duo 4GB (MagicGate) card. After a while the card stopped working. It gave an error C:13:01 on the Sony Cybershot I tried it on (Reinsert the Memory Stick). I even tried it on another camera and that [...]

 

GPS testing with LCD Character Display

July 25th, 2010

Its pretty easy testing out your GPS module if you have an LCD screen using your Arduino.

GPS System showing Latitude.

You can have the LCD output latitude, longitude, or whatever. You’ll need the TinyGPS library from Arduiniana downloaded and installed for it to work. They suggest using NewSoftSerial, but I couldn’t get that to work, so I scrapped that portion. Here’s my code.


#include "TinyGPS.h"
TinyGPS gps;


#include
// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);


void setup()
{
Serial.begin(38400);
lcd.begin(20,4);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Steven Johal");
lcd.setCursor(0,1);
lcd.print("GPS System showing");
lcd.setCursor(0,2);
lcd.print("Lat, lon, speed..");
}
void loop(){
if (Serial.available() > 0){
if (gps.encode(Serial.read()))
{


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 hhmmsscc, date in ddmmyy
gps.get_datetime(&date, &time, &fix_age);


// returns speed in 100ths of a knot
speed = gps.speed();


// course in 100ths of a degree
course = gps.course();


lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row)
lcd.print("Lat");
lcd.print(lat);
if(lat == 3750465){
lcd.clear();
lcd.print("Rubios!");
}
delay(1000);
}
}
}

I threw in a quick if/then statement to display Rubios on the screen if I got to that latitude position. Throw in an && to check for longitude as well for a proper point. I just check Rubios location on Google earth and took its latitude and put it into a calculator to give me the decimal.

GPS System showed the location at Rubio's.

4 Line Version of GPS to LCD system.

Similar Posts

Comments