From 81266028d53bbf75efa1f7df3e4c1926e93fcf31 Mon Sep 17 00:00:00 2001 From: WayenWeng Date: Fri, 23 Jun 2017 15:07:20 +0800 Subject: [PATCH] Update --- main.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.ts b/main.ts index c6aec4c..264510a 100644 --- a/main.ts +++ b/main.ts @@ -81,11 +81,13 @@ namespace grove { if (!paj7620) { paj7620.init(); control.inBackground(() => { - const gesture = paj7620.read(); - basic.showNumber(data ++); - if (gesture != lastGesture) { - lastGesture = gesture; - control.raiseEvent(gestureEventId, lastGesture); + while(true) { + const gesture = paj7620.read(); + if (gesture != lastGesture) { + lastGesture = gesture; + control.raiseEvent(gestureEventId, lastGesture); + } + basic.pause(50); } }) }