-
• #2
Hi user136708,
Rather than writing the GPS lat lon into cliock it would be better to write an app called my location. All mylocation will do is get a gps fix and write lat/lon to mylocation. Json. Then every app that needs your main location can read that. I had thought of doing this myself as I want to add sunrise and sunset to one of my clocks.
Also I wrote a library for gps, called geoutils. Its in gps touch app. I would be interested in extending that with the sunrise sunset calculations based on the value stored in mylocation. Json.
-
• #3
Hi user136708, @Gordon
I tried out your cliockJS2Enhanced clock as I wanted to see what you had done with sunrise / sunset.
I did some work on cliock back in Januarry I added the infoMode and FunctionMode lines. I cant claim to be the original coder of CLIOCK - but I did add the info mode line concept.@Gordon - I was not able to get infoMode to cycle. There no longer appears to be a BTN1 event.
I think this problem got introduced in v0.14 with your Fix BTN1 change.
Basically I would expect to be able to tap the top right edge of the bangle 2 and for the info mode display to cycle. This no longer happens on both watches.functionMode still works as tapping in botton left will bring up the HRM On/Off control.
Does the BTN1 fix require a specific version of firmware to work.
Update: Looks like I need a firmware update
https://github.com/espruino/BangleApps/issues/853
Update: Updated firmware and BTN1 works again. -
• #4
Hi user136708
I tried out cliockJS2Enhanced but could not find the sunrise / sunset code or display.
BTW the way. I think if you update to the latest firmware you will ge able to get the function mode to work again. But I was thinking about taking that out as its a bit confusing - better to keep the App simple. There's no real need to be able to power the heart rate sensor on / off in this App. If you want heart rate you should use a different App etc.
In Bangle 2 - I think the way this should work is swipe left / right to cycle forwards or backwards through the different info displays. And maybe sunrise and sunset should be options in that list.
There is also a much more elegant way to code cycling through these displays which results in a lot less code and variables. See gpstouch app for how I did this - which I copied from another clock that quoted cliock as inspiration. I might spend an evening revisting the cliock to improve the code.
I like what you did to make the TIME easier to read. -
• #5
With the firmware update, I could be wrong here but I think it may only be if you have one of the cutting edge builds. I think 2v10 would be ok.
But... I'm planning on pushing a 2v11 release soon. The only thing that's stopping me is a build failure for microbit1 because the firmware has got too big now - when I get some time to sort that out we;ll be good
If you want heart rate you should use a different App etc.
I think that's probably a good idea, yes.
In Bangle 2 - I think the way this should work is swipe left / right
That could be a good idea, yes. Could swipe left/right not be used for Bangle.js 1 as well.
-
• #6
Hi Hugh, sorry for the confusion. My tweaks are in cliSun.js, attached to the first post.
Hi Board,
I forked the forked cli-clock from the app page - https://github.com/espruino/BangleApps/tree/master/apps/cliclockJS2Enhanced
Except I didn't actually fork it, because the relevant git repo is the whole app site. For the avoidance of doubt, my changes are MIT licence.
1: Is there a sensible way to clone a single app, or a sensible way to clone the whole app repo and put it sensibly in the projects folder?
I had a few false starts importing the suncalc code from elsewhere - it looks like the IDE grabbed a copy of the code and my watch doesn't need access to the internet to run this, that took a little bit of thought.
I've added two more lines - sunrise and sunset in local time. I get the winter blues, it helps me not get shocked that it's dark at 5pm.
2: Does anyone know a sensible icon for sunrise/sunset that I can pass into the writeLine function, or is my best bet hacking together a vector/bitmap and telling the writeline to leave space for the image?
Next steps are to grab location from the GPS rather than hardcoding my city. I'll be back when I get the hang of it and get a bit more free time.
1 Attachment