always shake when button is pressed (#2161)
This commit is contained in:
parent
1eec659894
commit
12ddb5c72e
@ -267,7 +267,7 @@ namespace pxsim {
|
|||||||
++this.sigma;
|
++this.sigma;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.sigma >= DAL.MICROBIT_ACCELEROMETER_GESTURE_DAMPING) {
|
if (this.currentGesture !== this.lastGesture && this.sigma >= DAL.MICROBIT_ACCELEROMETER_GESTURE_DAMPING) {
|
||||||
this.enqueueCurrentGesture();
|
this.enqueueCurrentGesture();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -278,10 +278,8 @@ namespace pxsim {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enqueueCurrentGesture() {
|
private enqueueCurrentGesture() {
|
||||||
if (this.currentGesture != this.lastGesture) {
|
this.lastGesture = this.currentGesture;
|
||||||
this.lastGesture = this.currentGesture;
|
board().bus.queue(DAL.MICROBIT_ID_GESTURE, this.lastGesture);
|
||||||
board().bus.queue(DAL.MICROBIT_ID_GESTURE, this.lastGesture);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user