turn on samples when reading accelerometer (#2413)
This commit is contained in:
parent
2f3c1ff628
commit
2c85f91489
@ -199,6 +199,8 @@ namespace input {
|
|||||||
//% parts="accelerometer"
|
//% parts="accelerometer"
|
||||||
//% gesture.fieldEditor="gestures" gesture.fieldOptions.columns=4
|
//% gesture.fieldEditor="gestures" gesture.fieldOptions.columns=4
|
||||||
bool isGesture(Gesture gesture) {
|
bool isGesture(Gesture gesture) {
|
||||||
|
// turn on acceleration
|
||||||
|
uBit.accelerometer.getX();
|
||||||
int gi = (int)gesture;
|
int gi = (int)gesture;
|
||||||
return uBit.accelerometer.getGesture() == gi;
|
return uBit.accelerometer.getGesture() == gi;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user