So, if you are new to GPS and you haven't yet installed the GPS Library for Proteus, then you must first download that library and install it. I am using Arduino board in today's tutorial but you can use any other microcontroller as well like PIC Microcontroller or 8051 Microcontroller. So, let's get started with the Interfacing of GPS Module with Arduino in Proteus ISIS. I have explained this project in detail in the below video:
#include <TinyGPS.h> TinyGPS gps; //Creates a new instance of the TinyGPS object void setup() { Serial.begin(9600); Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version()); Serial.println("Testing GPS"); Serial.println("Designed by: www.TheEngineeringProjects.com"); Serial.println(); } void loop() { bool newData = false; unsigned long chars; unsigned short sentences, failed; // For one second we parse GPS data and report some key values for (unsigned long start = millis(); millis() - start < 1000;) { while (Serial.available()) { char c = Serial.read(); //Serial.print(c); if (gps.encode(c)) newData = true; } } if (newData) //If newData is true { float flat, flon; unsigned long age; gps.f_get_position(&flat, &flon, &age); Serial.print("Latitude = "); Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6); Serial.print(" Longitude = "); Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6); } Serial.println(failed); // if (chars == 0) // Serial.println("** No characters received from GPS: check wiring **"); }
If you have any questions then ask in the comments and I will try to resolve them. Take care. :)