Created a flashlight module

This commit is contained in:
Blue Fox 2022-06-05 09:52:06 +02:00
parent 4300a4bfe8
commit 8b4a325e49

23
flashlight.trailsense.js Normal file
View File

@ -0,0 +1,23 @@
(() => {
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 };
})();