Pages: [1]   Go Down
Author Topic: help in GPS code  (Read 655 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 <FILENAME>
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:
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
  }
}
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#include arduino.h
#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
There is a pattern here that your added include statement (not needed) failed to follow.

The latest version of TinyGPS has been updated to work with post-1.0 versions of the IDE. Download a newer version.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 <FILENAME>
gps_ino.cpp: In function 'bool feedgps()':
gps_ino:78: error: 'class SoftwareSerial' has no member named 'available'
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ok i downloaded ardunio 0022
Why?

Quote
gps_ino.cpp:13:10: error: #include expects "FILENAME" or <FILENAME>
Code:
#include arduino.h
So, where ARE the "" or <>?

Quote
gps_ino:78: error: 'class SoftwareSerial' has no member named 'available'
That's true. It doesn't.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ok i downloaded ardunio 0022
Why?
isn't it a newer version than the 1.0 version

Quote
gps_ino.cpp:13:10: error: #include expects "FILENAME" or <FILENAME>
Code:
#include arduino.h
So, where ARE the "" or <>?
i put it

Quote
gps_ino:78: error: 'class SoftwareSerial' has no member named 'available'
That's true. It doesn't.
so how can i solve this?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
isn't it a newer version than the 1.0 version
Not by a couple of years. 1.0.5 is the latest non-beta version.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 <FILENAME>
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

Logged

Saskatchewan, Canada
Offline Offline
Edison Member
*
Karma: 49
Posts: 1385
Coding Geezer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You wouldn't get this:

Quote
gps.ino:1:10: error: #include expects "FILENAME" or <FILENAME>

if you had " or <> arrounfd an include filename..
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I redownloaded the 1.5 version
Try again. Download the 1.0.5 version. NOT SOME OTHER STINKING VERSION!

Then, download the latest copy of TinyGPS. NOT SOME OLD VERSION!
Logged

Pages: [1]   Go Up
Jump to: