-
-
-
Good morning!
I just compared the moon phase calculation of the moon phase widget with that of my moon phase complication for analog clocks using the following code:
function compareMoonphasesAt (today) { /**** Code from Moonphase Widget ****/ const MC = 29.5305882, NM = 694039.09; var r = 11, mx = this.x + 12; my = this.y + 12; function moonPhase(d) { var tmp, month = d.getMonth(), year = d.getFullYear(), day = d.getDate(); if (month < 3) {year--; month += 12;} tmp = ((365.25 * year + 30.6 * ++month + day - NM) / MC); return Math.round(((tmp - (tmp | 0)) * 7)+1); } /**** Code from Moonphase Complication ****/ const MillisPerDay = 86400000; const synodicalMonth = 29.530588; let Phase = ( (today/MillisPerDay - new Date(2009,11,31, 20,12,36)/MillisPerDay) % synodicalMonth ) / synodicalMonth; if (Phase < 0) { Phase += 1; } // just in case that date is completely wrong /**** make the latter comparable to the former ****/ Phase -= 0.5; if (Phase < 0) { Phase += 1; } Phase = Math.round(Phase * 7)+1; /**** print comparison ****/ let day = today.getDate(); print( '2022-01-' + (day < 10 ? '0' : '') + day + ': ' + moonPhase(today) + ' vs. ' + Phase ); } for (let Day = 17-14; Day < 17+14; Day++) { compareMoonphasesAt(new Date(2022,0,Day)); }
The output of that little script is:
2022-01-03: 8 vs. 8 2022-01-04: 1 vs. 1 2022-01-05: 1 vs. 1 2022-01-06: 2 vs. 2 2022-01-07: 2 vs. 2 2022-01-08: 2 vs. 2 2022-01-09: 2 vs. 2 2022-01-10: 3 vs. 3 2022-01-11: 3 vs. 3 2022-01-12: 3 vs. 3 2022-01-13: 3 vs. 3 2022-01-14: 4 vs. 4 2022-01-15: 4 vs. 4 2022-01-16: 4 vs. 4 2022-01-17: 4 vs. 4 2022-01-18: 5 vs. 5 2022-01-19: 5 vs. 5 2022-01-20: 5 vs. 5 2022-01-21: 5 vs. 5 2022-01-22: 5 vs. 5 2022-01-23: 6 vs. 6 2022-01-24: 6 vs. 6 2022-01-25: 6 vs. 6 2022-01-26: 6 vs. 6 2022-01-27: 7 vs. 7 2022-01-28: 7 vs. 7 2022-01-29: 7 vs. 7 2022-01-30: 7 vs. 7
This looks as if the calculation itself is correct.
What might lead to less optimal graphics is the low number of different indices - compared to user requirements (e.g., according to the numbers, "full moon" is shown from Jan 14 to Jan 17 incl. - this collides with "it's ever so slightly slightly waning")
Thus, what may (might?) finish this discussion could be a more detailed drawing of the current moon phase in the widget?
-
-
-
Well, I don't know if @Gordon likes my code style (I'm not using any IDE but my own aspect-oriented code generation system (for multiple programming languages) backed by a database - completely different from what other people normally use). But the result is MIT-licensed anyway, thus, if he finds it useful, he may integrate it in whatever way he likes (including docs)
Please note: the ACCK is not an app! AC-AC however is - but that's already part of the Bangle apps.
I would feel honoured if I could bring Bangle.js development forward a little bit!
-
I just renamed the "four-fold" and "twelve-fold" clock faces to "four-numbered" and "twelve-numbered" and created new GitHub repositories for them. The new names seem to be more accurate than the old ones.
The old repositories will remain for a while before they eventually will be deleted. All docs and examples have been adapted to the new names and repos. New users should not experience any difficulties, legacy users should change to the new faces/repos within the next few weeks.
-
I just renamed the "four-fold" and "twelve-fold" clock faces in AC-AC to "four-numbered" and "twelve-numbered". The new names seem to be more accurate than the old ones.
The only change you should notice (among the updated instructions) may be, that AC-AC does not remember a previously chosen "four-fold" or "twelve-fold" clock face - but this should happen at most once.
-
-
-
Well, unfortunately, I don't have any time to develop s.th. like AC-DC in the moment - it should be better if somebody else would care about a version for digital clocks.
Concerning clocks with second hands: second hands will only be drawn while the touchscreen is unlocked (and the LCD backlight on). As a consequence, only then the refresh rate will be one per second, otherwise it will be one per minute.
-
Cool!
Did you really just use AC-AC (with a custom clock face) or the ACCK using the Bitmap Clock Background with a custom bitmap?
-
Thank you very much for the praise!
Why don't you write a complication yourself? Because of expected numbers in the 1000s and, perhaps, 10000s, I'd assume that "larger" complications are a requirement (i.e., positions "t" or "b" only) - and in that case, you could use the "date" complication as a basis.
I do not have any more time for Bangle.js development right now - for that reason, I'd prefer if people would start working with the ACCK and develop their own parts - thats what the kit was made for!
-
-
Well, I hate boiler plating - and Java often requires that (which is why I was heavily working with Groovy in a professional environment around a decade ago). On the other side, plain JavaScript is too unregulated, which is why I actually prefer "TypeScript" (very well done, Microsoft!) - hoping that I do not have to write too many nested asynchronous functions (as the handling of asynchrony is the biggest design flaw of JavaScript today - here is Java much(!) better)
Another big argument for JS: it's the "lingua franca" of the web and well supported even in older browsers (in older tablets, smartphones, PCs etc.) in contrast to WASM - including debugging.
Additionally, as far as I remember: JS is even supported by some microcontrollers - and, finally, by some smartwatches. I can hardly remember, but allegedly there was an environment called...Espruino? And I've heard of a smartwatch called "Bangle.js" (or similar) which is supposed to support JS.
(Just for the records: there is an alternative called Kaluma available for the Raspberry Pico - sometimes, you actually need the performance of an RP Pico, and in that case, Kaluma seems to be a good choice)
-
-
-
-
-
I just added a configuration backup and restore facility which frees you from having to enter a once chosen configuration over and over again - now, the most recently configured settings will just be restored as soon as you visit the (same) app loader again (with the same browser on the same device)
-
-
roman numerals may now be configured as well (now available in the official App Loader)
-
Well, unfortunately I have to earn my living and, thus, to concentrate on other things now. I had hoped to create more within the time I had but ACCK and AC-AC do not look all too bad for the beginning.
Concerning Bangle.js 2 and my CS lectures: well, definitely not during this semester (exam phase will start in three weeks).
At the beginning of this semester, I gave a away a few "Maker UNO"s and now hope to see what my students did with them by tomorrow or next friday.
For the next semester, I plan to concentrate on the RasPi Zero 2 as it covers everything - from "hardware computing" over development with Linux to Linux administration.
Bangle.js programming is based on JavaScript - and (although I personally prefer JS over Java) this creates a problem: at "my" university, students will learn Java as their primary programming language - some of them will start as pure beginners in that area. And even if it makes my heart bleed, I strongly recommend NOT to learn JS and Java at the same time - otherwise you wouldn't be able to do either of them really well.
Therefore, I will definitely introduce the Bangle.js 2 as an example of what individuals or small groups can achieve today - but I doubt that I will start any projects for my students with it. Perhaps, however, I'll call for a small competition (letting students develop and publish their own software and/or hardware projects or even found their own small start-ups) and offer my Bangle.js development clock as a prize...we'll see
Thank you very much for your enormous effort!