Morning experts. I am fairly new to the GPS end of Arduino. I am using example code from the new tinyGPS++ library and I am getting an error that I can't seem to understand why it doesn't like this. I have looked up the definition and I don't understand what that is either. Your help in finding my issue and describing what that error means when it shows up would be most appreciated. Here is my complete code
//display
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);//set to I2C address, number of digits, number of rows)
//gps
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
SoftwareSerial gpsSerial(2,3); //TX=2 RX=3
TinyGPSPlus gps;
//Declarations
float lattitude,longitude;
int count=0;
const int fixLED = 13;
const float deg2rad = 0.01745329251994;
const float rEarth = 6371000.0; //can replace with 3958.75 mi, 6370.0 km, or 3440.06 NM
float range = 3000; // distance from HERE to THERE in meters to open box, (diameter of circle that enables opening)
String here; //variable to hold destination location.
//Servo
#include <PWMServo.h>
PWMServo servoLatch;
int servoPin = 9; // pin for servo
int servoLock = 110; // angle (deg) of "locked" servo
int servoUnlock = 0;
const double WALKING_BRIGDE_LAT = 38.732792;
const double WALKING_BRIDGE_LNG = -120.745646;
void setup() {
gpsSerial.begin(9600);
Serial.begin(9600);
lcd.begin();
servoLatch.attach(SERVO_PIN_A);
servoLatch.write(servoLock);
delay(50);
pinMode (fixLED, OUTPUT);
digitalWrite(fixLED, HIGH);
delay(250);
digitalWrite(fixLED, LOW);
}//setup
void loop() {
while (gpsSerial.available() > 0)
gps.encode(gpsSerial.read());
/*
Serial.print("LAT="); Serial.println(gps.location.lat(), 6);
Serial.print("LONG="); Serial.println(gps.location.lng(), 6);
Serial.print("ALT="); Serial.println(gps.altitude.feet());
*/
if (millis() > 5000 && gps.charsProcessed() < 10)
{
Serial.println("No GPS detected");
while(true);
}
//fix LED lit when good fix available. Blue light will flash upon startup to verify connections then will light when GPS fix is obtained
if (gps.location.age()<1500){digitalWrite(fixLED, HIGH);}
if (gps.location.age()>1500){digitalWrite(fixLED, LOW);}
if (gps.location.isUpdated())
{
lcd.home();
lcd.print("current fix");
lcd.setCursor(0,1);
lcd.print("lat= ");
lcd.print(gps.location.lat(), 6);
lcd.setCursor(0,2);
lcd.print("long= ");
lcd.print(gps.location.lng(), 6);
lcd.setCursor(0,3);
lcd.print("alt= ");
lcd.print(gps.altitude.feet());
}
double distanceKm =
TinyGPSPlus.distanceBetween(
gps.location.lat(),
gps.location.lng(),
WALKING_BRIGDE_LAT,
WALKING_BRIDGE_LNG) / 1000.0;
double courseTo =
TinyGPSPlus.courseTo(
gps.location.lat(),
gps.location.lng(),
WALKING_BRIGDE_LAT,
WALKING_BRIDGE_LNG);
/*
Serial.print("Distance (km) to Walking Bridge: ");
Serial.println(distanceKm);
Serial.print("Course to Walking Brigde: ");
Serial.println(courseTo);
Serial.print("Human directions: ");
Serial.println(TinyGPSPlus.cardinal(courseTo));
*/
}//loop
here is the error message that I'm getting.
C:\Users\machine\Documents\Arduino\Reverse_geocashe_buildup_MK1_Mod4\Reverse_geocashe_buildup_MK1_Mod4.ino: In function 'void loop()':
Reverse_geocashe_buildup_MK1_Mod4:103:14: error: expected primary-expression before '.' token
TinyGPSPlus.distanceBetween(
^
Reverse_geocashe_buildup_MK1_Mod4:111:14: error: expected primary-expression before '.' token
TinyGPSPlus.courseTo(
^
exit status 1
expected primary-expression before '.' token
additional details. Arduino Uno, 4x20 LCD, UBLOX GY-NEO6MV2
I'm still working up a version of a reverse geocashe box but I want to understand what everything is doing so that I can use it in other places. Thank you for your attention
a machine tech