You can try the following code:
Bangle.on("swipe", function(dirLeftRight, dirUpDown) { if (dirLeftRight == -1) { // left console.log("left"); } else if (dirLeftRight == 1) { // right console.log("right"); } else if (dirUpDown == -1) { // up console.log("Up"); } else if (dirUpDown == 1) { // down console.log("Down"); } });
That's perfect. Thanks!
@BartS23 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.
You can try the following code: