I am working with TinyGPS++ library and Arduino-nano and I want to change the update rate. I worked before with Adafruit GPS and uses the below code for updating it.
// Set the update rate
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 1 Hz update rate
I have also worked with NMEAGPS.h
to update every 30sec.
gps.send_P( &gpsPort, F("PMTK220,30000") ); //update 1time in 30s
So how to change the upsate rate for TinyGPS++ library? as I want to update 1 time in 30seconds.
asked Nov 29, 2020 at 9:04
-
I looked at the source code and it appears that the library checks for a new complete sentance as fast as you call the method encode. From your question, it is not clear if this library is working too slow or too fast for your application. But it does appear your application is in charge of any desired delay.st2000– st20002020年11月29日 15:34:56 +00:00Commented Nov 29, 2020 at 15:34
-
@st2000 I just want an update after every 30second.Krupali Mistry– Krupali Mistry2020年11月30日 01:49:10 +00:00Commented Nov 30, 2020 at 1:49
-
If your code does not need to do anything else, I'm thinking you can simply call delay milliseconds with 30000 each time in between calling encode(). If you would like to do other things during that time, then you need to implement a state machine.st2000– st20002020年11月30日 01:53:42 +00:00Commented Nov 30, 2020 at 1:53
-
can you explain with an example?Krupali Mistry– Krupali Mistry2020年11月30日 01:57:58 +00:00Commented Nov 30, 2020 at 1:57
-
1This example TinyGPS code appears to attempt to grab new GPS data once a second. Guessing, if you increase the loop counter on line 30 from 1000 to 30000, the delay will increase from once a second to once every 30 seconds.st2000– st20002020年11月30日 04:29:28 +00:00Commented Nov 30, 2020 at 4:29
default