Some code for an example. If you define your widget as
WIDGETS.mywidget = { area: ..., draw: ..., width: ..., someVariable: 123, someFunction: () => { ... }, };
Then in your clock, after calling Bangle.loadWidgets(), you can use WIDGETS.mywidget.someVariable and WIDGETS.mywidget.someFunction().
Bangle.loadWidgets()
WIDGETS.mywidget.someVariable
WIDGETS.mywidget.someFunction()
@malaire started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Some code for an example. If you define your widget as
Then in your clock, after calling
Bangle.loadWidgets()
, you can useWIDGETS.mywidget.someVariable
andWIDGETS.mywidget.someFunction()
.