This is driving me bananas. I swear I have everything set. I'm new to this Arduino thing, but I feel everything is right.
I'm using an example from Sparkfun, but something is missing. Any help is greatly appreciated. I need these weather probes functioning for the big severe weather outbreak tomorrow, and the GPS is my problem.
Using Arduino 1.0.5-r2
Uno R3 Board
I left out all the weather parts of the code which is working fine.
The GPS is connected to the WeatherShield via the serial connector.
Weather Shield: https://www.sparkfun.com/products/12081
GPS Receiver: GPS Receiver - GP-735 (56 Channel) - GPS-13670 - SparkFun Electronics
/*
Weather Shield Example
By: Nathan Seidle
SparkFun Electronics
Date: November 16th, 2013
This example code assumes the GP-635T GPS module is attached.
*/
#include <Wire.h> //I2C needed for sensors
#include "MPL3115A2.h" //Pressure sensor
#include "HTU21D.h" //Humidity sensor
#include <SoftwareSerial.h> //Needed for GPS
#include <TinyGPS.h> //GPS parsing
TinyGPS gps;
static const int RXPin = 5, TXPin = 4; //GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)
SoftwareSerial ss(RXPin, TXPin);
MPL3115A2 myPressure; //Create an instance of the pressure sensor
HTU21D myHumidity; //Create an instance of the humidity sensor
float flat, flon;
// returns +/- latitude/longitude in degrees
gps.f_get_position(&flat, &flon);
float falt = gps.f_altitude(); // +/- altitude in meters
float fc = gps.f_course(); // course in degrees
float fk = gps.f_speed_knots(); // speed in knots
float fmph = gps.f_speed_mph(); // speed in miles/hr
float fmps = gps.f_speed_mps(); // speed in m/sec
float fkmph = gps.f_speed_kmph(); // speed in km/hr
char sz[32];
Serial.print(",date=");
sprintf(sz, "%02d/%02d/%02d", gps.date.month(), gps.date.day(), gps.date.year());
Serial.print(sz);
Serial.print(",time=");
sprintf(sz, "%02d:%02d:%02d", gps.time.hour(), gps.time.minute(), gps.time.second());
Serial.print(sz);
Serial.print(",");
Serial.println("#");
}
I'm getting these errors.
Weather_Shield_with_GPS.ino: In function 'void printWeather()':
Weather_Shield_with_GPS:457: error: 'class TinyGPS' has no member named 'date'
Weather_Shield_with_GPS:457: error: 'class TinyGPS' has no member named 'date'
Weather_Shield_with_GPS:457: error: 'class TinyGPS' has no member named 'date'
Weather_Shield_with_GPS:461: error: 'class TinyGPS' has no member named 'time'
Weather_Shield_with_GPS:461: error: 'class TinyGPS' has no member named 'time'
Weather_Shield_with_GPS:461: error: 'class TinyGPS' has no member named 'time'
I defined the TinyGPS library <TinyGPS.h>and included it.
This is in the library
public:
TinyGPSPlus();
bool encode(char c); // process one character received from GPS
TinyGPSPlus &operator << (char c) {encode(c); return *this;}TinyGPSLocation location;
TinyGPSDate date;
TinyGPSTime time;
TinyGPSSpeed speed;
TinyGPSCourse course;
TinyGPSAltitude altitude;
TinyGPSInteger satellites;
TinyGPSDecimal hdop;
So the Date and Time is already defined.
Thanks for your help,
-Nick