I'm doing a school project where I'm making a device that gets it's own location coordinates and displays them on LCD. Since I'm not experienced with Arduino, I chose to follow a tutorial for my device. However the tutorial I picked is very bad, and it's unfortunately too late to choose another. The tutorial is here. Through a lot of extra research on things the tutorial should have mentioned, I managed to assemble the device. However, the code provided by the tutorial does not work properly.
// Creating a Simple GPS Receiver
#include <TinyGPS.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );
// Create an instance of the TinyGPS object
TinyGPS gps;
void getgps(TinyGPS &gps);
void setup()
{
Serial.begin(4800);
lcd.begin(16, 2);
}
void getgps(TinyGPS &gps)
// The getgps function will display the required data on the LCD
{
float latitude, longitude;
//decode and display position data
gps.f_get_position(&latitude, &longitude);
lcd.setCursor(0,0);
lcd.print("Lat:");
lcd.print(latitude,5);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("Long:");
lcd.print(longitude,5);
lcd.print(" ");
delay(3000); // wait for 3 seconds
lcd.clear();
}
void loop()
{
byte a;
if ( Serial.available() > 0 ) // if there is data coming into the serial line
{
a = Serial.read(); // get the byte of data
if(gps.encode(a)) // if there is valid GPS data...
{
getgps(gps); // grab the data and display it on the LCD
}
}
}
The code above is what the tutorial provided. When I try to compile it, it gives me the following error
Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"
C:\Users\(My computer)\Documents\FSID3LEHVLYA77X\FSID3LEHVLYA77X.ino:2:21: fatal error: TinyGPS.h: No such file or directory
#include <TinyGPS.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
The parts I used are the Arduino Uno R3, the Sparkfun 16x2 LCD, and the Sparkfun GPS shield.
I'm not really sure how to fix this, and my deadline is only getting closer. Any help would be greatly appreciated.