TrailSene-Bangle.js/flashlight.trailsense.js

24 lines
442 B
JavaScript

(() => {
function callbackFill(direction) {
if(direction == 1) {
g.setColor(255,255,255);
} else {
g.setColor(255,0,0);
}
g.fillRect(0, 0, g.getHeight(), g.getWidth());
}
function drawFace() {
g.setColor(255,255,255);
g.fillRect(0, 0, g.getHeight(), g.getWidth());
Bangle.on("swipe", callbackFill);
}
function stop() {
Bangle.removeListener("swipe", callbackFill);
}
return { drawFace:drawFace, stop:stop };
})();