Update
This commit is contained in:
parent
32cd08e94c
commit
d7fcfe1ff3
4
main.ts
4
main.ts
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user