Having issues with making the GPS Shield from Sparkfun work.
I have compile errors when using this code on the Particle platform. When I using Visual Studio Code as the editor, I get 2 of the following errors:
- The library.properties file within the ‘name’ field has the name ‘SparkFun I2C GPS Reading and Control’. When I compile, it doesn’t like having spaces in its name. Once I remove the spaces, it compiles.
- The 2nd error is that I get ‘class I2CGPS’ has no member named ‘begin’.
I have been using TingGPS.ino sample code supplied with this library.
Interestingly, I get no compile errors using the unmodified version of the library with the Arduino IDE. Its somehow related to the Particle platform. Considering the Photon is Arduino compatible, I am surprised that it has these issues.
Thanks for that. So just to confirm, I should change the coding in SparkFun_I2C_GPS_Arduino_Library.h file so that all the if-else statements that chooses between Arduino definition and MBED definition to always choose the Arduino definition?
Correct, that should do it, though I didn’t actually test to be sure.
Issue is that SparkFun_I2C_GPS_Arduino_Library.cpp also has the if-else statements. Do I change that too?
Should not be necessary because the first thing the .cpp file does is include the .h file, and if the .h file does a #include "Arduino.h"
then ARDUINO
will now be defined and everything will be fine. It’s just making sure that Arduino.h gets included or else everything else goes downhill from there.
#if defined(PARTICLE)
#include "Arduino.h"
#elif defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#include <Wire.h>
#elif defined(ARDUINO) && ARDUINO < 100
#include "WProgram.h"
#include <Wire.h>
#elif defined(__MBED__)
#include "mbed.h"
#include "externs.h"
#include <cstdlib>
#include <string>
#include "TinyGPSPlus/TinyGPS++.h"
#endif
Great it worked! Thanks for your help.
On other thing, I have loaded private libraries using the particle CLI command “particle library upload”. I no longer use them so how do I remove them? They seem to have a ‘lock’ on them in the web interface