GPS clock_info - a few questions #5826
Replies: 1 comment
-
Posted at 2023-04-21 by @gfwilliams Looks good, although I think you ought to provide an icon - IIRC most clocks expect one. I think the issue is just that you're calling Posted at 2023-04-22 by HughB Thanks for that, that worked. I have been testing the next iteration. My question is:
I'm not 100% sure I understand how this.timeout gets defined in code at: https://github.com/espruino/BangleApps/blob/master/apps/clock_info/lib.js
Posted at 2023-04-24 by @gfwilliams
Nope :)
It's defined in
Posted at 2023-04-24 by HughB
Thought so. Will fix to be consistent My App is available for test at: Latest code at: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-04-20 by HughB
I'm working on a GPS clock_info. But have a few questions as I am not sure I have got the code right below.
GOAL: I am buiding a simple GPS clock_info that will show the OS map grid coordinates for use when walking. When you swipe to the gps clock info it turns on the GPS. The first time it gets a fix display the time value from the fix.time from the GPS. Once a fix is established turn off the GPS and then start a timer to turn it back on 3 minutes (I will probably choose 90 seconds later on). The goal is to be able to get a GPS fix every 3 mins or so. This is good enough when walking. As long as you have downloaded AGPS the time to first fix is a few minutes. After that it takes about 20 seconds from power to next fix providing the distance travelled is small (which it will be when on foot). In this way the battery drain of turning on the GPS is reduced to 20 seconds every 3 minutes. I have a library module that I made for GPStouch that will do the lat/lon to OS grid conversion. For now I am just displaying the lat/lon.
My code is below.
Problem is that while onGPS() is getting called the info.emit('redraw'); does not seem to result in a redraw. The only way to get an update is to tap the screen again, then it will update.
Would appreciate any feedback on the code as stuff with timers like this can go wrong.
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions