I see a really nifty-looking module in the BangleApps repo called ClockFace.js (https://github.com/espruino/BangleApps/blob/master/modules/ClockFace.js) that says it can take care of a lot of clockface boilerplate. When I try to require it though, it says it can't find the module.
How do I go about including this? Should I upload the file to my watch, or is it included in the firmware already somehow like Layout.js (which happens to be along side it in that repo...)? Is this a staging area for modules that are going to be added in a future firmware release, or am I becoming very confused?
And a related question, how can I list the built-in modules that are available to be required? For example, I don't see Layout.js listed in the files loaded on my watch, yet I can require it.
I think I found the answer to one of my questions. The modules directory is for modules developed by people who've published to the BangleApps repo.
So the next logical question is, how does the app loader know that it needs to load a module? Is there some code that scans for "require" calls, I'm guess? I don't see it get defined explicitly...
Best bet is to look at the README file in that modules folder: https://github.com/espruino/BangleApps/blob/master/modules/README.md
It covers pretty much exactly what you need to know about developing with it :)
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem