I’m trying to get this woking, very new to particle experiments… I’m trying to read Gps some how it is not posting
Lat and Lon to my data sheet. can someone help please.
Hi Thankyou so much… for response, Dont know, when I run my electron events from my “particle” application on phone… Batery event returns “1” with values. But Gps is returning “0” with error. What exact serial output means?? Kindly let me know i will check it and let you know…
Serial.println(t.preNMEA());
// or
Serial.println(t.readLatLon());
When you have your Electron connected via USB to a computer you can use a serial terminal (or Particle CLI via particle serial monitor) to catch these outputs and see what's going on with your code.
That's exactly the reason why I asked[quote="ScruffR, post:2, topic:32041"]
Have you got a fix on the GPS receiver?
[/quote]
Since this code only reports data when you have
if(t.gpsFix()){ // <-- only once you got a GPS fix you can read the data!!!
Particle.publish("G", t.readLatLon(), 60, PRIVATE);
return 1;
}
I see thank you Scruff, I appreciate that. Actually, it was copied code from online tried personally with interest, could you give me sample code to do or something to post Lat and Lon from Electron for each minute.
I’m a dot net developer, sometimes I do interest doing this experiment can you help me if possible.
Thanks for a very frequent response for my experiment.
@Ghani, the code WILL work as is but ONLY once a fix is obtained. Once a fix is obtained, it will publish every delayMinutes. So if you want data every minute, set delayMinutes to 1.