add handling of gestures (we only have 2g, 6g ... no 3g), add mac/idea ignored files

This commit is contained in:
Matthias L. Jugel
2016-10-18 15:44:49 +02:00
parent 47f46553e0
commit f10ac93268
5 changed files with 59 additions and 1 deletions

View File

@ -130,7 +130,7 @@ namespace input {
//% parts="accelerometer"
void onGesture(Gesture gesture, Action body) {
if ((int)gesture == MICROBIT_ACCELEROMETER_EVT_3G && uBit.accelerometer.getRange() < 3)
uBit.accelerometer.setRange(4);
uBit.accelerometer.setRange(6);
else if ((int)gesture == MICROBIT_ACCELEROMETER_EVT_6G && uBit.accelerometer.getRange() < 6)
uBit.accelerometer.setRange(8);
registerWithDal(MICROBIT_ID_GESTURE, (int)gesture, body);