So I have an asset tracker and I am updating a cloud variable with the latitude and longitude. However, I am unfamiliar with the asset tracker library. The one I am using (not sure if there is more than one) is just called AssetTracker. My problem is that I want to stop the electron from updating the GPS location when a variable is equal to 1. But I do not know how to stop the updating. I would also like to resume updating the location after I stop it.
Right now I have it so it checks for a variable to be equal to 1, and if it does, it runs this code:
if(u == 1) {
Serial.println("U is 1");
if (t.gpsFix()) {
// Only publish if we're in transmittingData mode 1;
if (transmittingData) {
// Short publish names save data!
//Particle.publish("G", t.readLatLon(), 60, PRIVATE);
Particle.publish("G", t.readLatLon(), PRIVATE);
gpsLocation = t.readLatLon();
}
// but always report the data over serial for local development
Serial.println(t.readLatLon());
}
}
I thought that when u is equal to 0, it would just stop updating, but the red light on the tracker keeps blinking and I think that is saying that it is still updating the GPS.
Thanks!