hi
iam trying my GPS code but i keep getting this errors i downloaded tinygps library but i couldn't find wprogram.h
the errors:
gps.ino:1:10: error: #include expects "FILENAME" or
In file included from gps.ino:2:
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:25:22: error: WProgram.h: No such file or directory
In file included from gps.ino:2:
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:81: error: 'byte' has not been declared
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:81: error: 'byte' has not been declared
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:130: error: 'byte' does not name a type
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:133: error: 'byte' does not name a type
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:134: error: 'byte' does not name a type
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:135: error: 'byte' does not name a type
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h: In member function 'void TinyGPS::get_position(long int*, long int*, long unsigned int*)':
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:48: error: 'millis' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h: In member function 'void TinyGPS::get_datetime(long unsigned int*, long unsigned int*, long unsigned int*)':
C:\Program Files (x86)\Arduino\libraries\TinyGPS10/TinyGPS.h:57: error: 'millis' was not declared in this scope
the code:
#include arduino.h
#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(4,5,6,7,8,9);
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);
lcd.begin(16, 2);
}
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);
getGPS();
lcd.setCursor(0,0);
lcd.print("Lt: ");
lcd.print(LAT/100000,7);
lcd.setCursor(0,1);
lcd.print("Ln: ");
lcd.print(LON/100000,7);
//Serial.print("Latitude : ");
//Serial.print(LAT/100000,7);
//Serial.print(" :: Longitude : ");
//Serial.println(LON/100000,7);
delay(1000);
}
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
}
}
ok i downloaded ardunio 0022 and compiled the code but still this errors came up
gps_ino.cpp:13:10: error: #include expects "FILENAME" or
gps_ino.cpp: In function 'bool feedgps()':
gps_ino:78: error: 'class SoftwareSerial' has no member named 'available'
I redownloaded the 1.5 version and i got these errors again
Arduino: 1.5.4 (Windows 7), Board: "Arduino Uno"
gps.ino:1:10: error: #include expects "FILENAME" or
In file included from gps.ino:2:
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:25:22: error: WProgram.h: No such file or directory
In file included from gps.ino:2:
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:81: error: 'byte' has not been declared
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:81: error: 'byte' has not been declared
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:82: error: 'byte' has not been declared
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:130: error: 'byte' does not name a type
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:133: error: 'byte' does not name a type
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:134: error: 'byte' does not name a type
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:135: error: 'byte' does not name a type
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h: In member function 'void TinyGPS::get_position(long int*, long int*, long unsigned int*)':
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:48: error: 'millis' was not declared in this scope
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h: In member function 'void TinyGPS::get_datetime(long unsigned int*, long unsigned int*, long unsigned int*)':
C:\Users\mohd\Desktop\arduino-1.5.4\libraries\TinyGPS10/TinyGPS.h:57: error: 'millis' was not declared in this scope