I’m new to coding so please forgive me if my questions are basic… My questions are related to this GPS Stream example, and are probably based around general handling of functions.
I want to just get the int values of this section of code ‘’ Serial.println(gps.getLat(), 7); ‘’, but i can’t get this (“gps.getLat(), 7”) to work as a function to return a value?
A general question with the examples such as the on in the link above - Why do I have to always use the code within a function called ‘‘BLYNK_WRITE(VX)’’ and not just write it into its own function in something like this:
I know this is probably pretty basic, but i don’t seem to understand whats going on here. Once i can get the value of the lat’s and long’s into int values (or long int values for that matter) i will be able to set up my GPS fence as IOS doesnt have a GPS radius trigger.
if i use the example code from here and cut it down to this it gives the lat correctly (-37.7141340):
BLYNK_WRITE(V5) {
GpsParam gps(param);
// Print 6 decimal places for Lat, Lon
Serial.println(gps.getLat(), 7);
}
Are you able to help me write the first bit to extract it to a value? Once i have this i will be able to build a GPS fence, which i can then share with everyone in the same situation.
The missing piece of information for me was the “, 7”. I was able to make my own functions, but because it was only giving 2 decimal places i thought there was something wrong with how i wrote it but had no idea the serial print was decimal place limited! its working how i need it to now, thanks so much!
ill build an example GPS fence trigger for ppl and post it later.