2016-04-05 13:23:42 -07:00
|
|
|
# Input
|
|
|
|
|
2016-05-05 11:16:14 -07:00
|
|
|
Events and data from sensors
|
2016-04-05 13:23:42 -07:00
|
|
|
|
|
|
|
```cards
|
2016-04-05 13:54:48 -07:00
|
|
|
input.onButtonPressed(Button.A, () => {
|
2016-04-05 13:23:42 -07:00
|
|
|
|
|
|
|
});
|
2016-04-05 13:54:48 -07:00
|
|
|
input.onGesture(Gesture.Shake, () => {
|
2016-04-05 13:23:42 -07:00
|
|
|
|
|
|
|
});
|
2016-04-05 13:54:48 -07:00
|
|
|
input.onPinPressed(TouchPin.P0, () => {
|
2016-04-05 13:23:42 -07:00
|
|
|
|
|
|
|
});
|
2016-04-05 13:54:48 -07:00
|
|
|
input.buttonIsPressed(Button.A);
|
2016-04-05 13:23:42 -07:00
|
|
|
input.compassHeading();
|
2016-07-27 08:42:58 -07:00
|
|
|
input.pinIsPressed(TouchPin.P0);
|
2016-04-05 13:23:42 -07:00
|
|
|
input.temperature();
|
2016-04-05 13:54:48 -07:00
|
|
|
input.acceleration(Dimension.X);
|
2016-04-05 13:23:42 -07:00
|
|
|
input.lightLevel();
|
2016-04-05 13:54:48 -07:00
|
|
|
input.rotation(Rotation.Pitch);
|
|
|
|
input.magneticForce(Dimension.X);
|
2016-04-05 13:23:42 -07:00
|
|
|
input.runningTime();
|
2016-04-05 13:54:48 -07:00
|
|
|
input.setAccelerometerRange(AcceleratorRange.OneG);
|
2016-04-05 13:23:42 -07:00
|
|
|
input.calibrate();
|
|
|
|
input.onLogoDown(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
input.onLogoUp(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
input.onScreenDown(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
input.onScreenUp(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
input.onShake(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
```
|
2016-08-08 13:08:15 -07:00
|
|
|
|
|
|
|
### See Also
|
|
|
|
|
2016-10-22 23:04:08 -07:00
|
|
|
[onButtonPressed](/reference/input/on-button-pressed), [onGesture](/reference/input/on-gesture), [onPinPressed](/reference/input/on-pin-pressed), [buttonIsPressed](/reference/input/button-is-pressed), [compassHeading](/reference/input/compass-heading), [pinIsPressed](/reference/input/pin-is-pressed), [temperature](/reference/input/temperature), [acceleration](/reference/input/acceleration), [lightLevel](/reference/input/light-level), [rotation](/reference/input/rotation), [magneticForce](/reference/input/magnetic-force), [runningTime](/reference/input/running-time), [setAccelerometerRange](/reference/input/set-accelerometer-range)
|