This commit is contained in:
WayenWeng 2017-06-23 12:59:32 +08:00
parent 32cd08e94c
commit d7fcfe1ff3

View File

@ -69,7 +69,7 @@ namespace grove {
const gestureEventId = 3100; const gestureEventId = 3100;
let lastGesture = GroveGesture.None; let lastGesture = GroveGesture.None;
let paj7620: PAJ7620 = undefined; let paj7620: PAJ7620 = undefined;
let data: number = 0;
/** /**
* Do something when a gesture is detected by Grove - Gesture * Do something when a gesture is detected by Grove - Gesture
* @param gesture type of gesture to detect * @param gesture type of gesture to detect
@ -82,7 +82,7 @@ namespace grove {
paj7620.init(); paj7620.init();
control.inBackground(() => { control.inBackground(() => {
const gesture = paj7620.read(); const gesture = paj7620.read();
basic.showNumber(gesture) basic.showNumber(data ++);
if (gesture != lastGesture) { if (gesture != lastGesture) {
lastGesture = gesture; lastGesture = gesture;
control.raiseEvent(gestureEventId, lastGesture); control.raiseEvent(gestureEventId, lastGesture);