2016-04-05 22:23:42 +02:00
|
|
|
# Input
|
|
|
|
|
2016-05-05 20:16:14 +02:00
|
|
|
Events and data from sensors
|
2016-04-05 22:23:42 +02:00
|
|
|
|
|
|
|
```cards
|
2022-08-10 18:36:19 +02:00
|
|
|
input.onButtonEvent(Button.A, input.buttonEventClick(), function () {})
|
|
|
|
input.onGesture(Gesture.Shake, function () {})
|
|
|
|
input.onPinEvent(TouchPin.P0, input.buttonEventDown(), function() {})
|
|
|
|
input.buttonIsPressed(Button.A)
|
|
|
|
input.pinIsPressed(TouchPin.P0)
|
|
|
|
input.isGesture(Gesture.Shake)
|
|
|
|
input.compassHeading()
|
|
|
|
input.temperature()
|
|
|
|
input.acceleration(Dimension.X)
|
|
|
|
input.lightLevel()
|
|
|
|
input.rotation(Rotation.Pitch)
|
|
|
|
input.magneticForce(Dimension.X)
|
|
|
|
input.runningTime()
|
|
|
|
input.runningTimeMicros()
|
|
|
|
input.setAccelerometerRange(AcceleratorRange.OneG)
|
2016-04-05 22:23:42 +02:00
|
|
|
```
|
2016-08-08 22:08:15 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See also
|
2016-08-08 22:08:15 +02:00
|
|
|
|
2022-08-10 18:36:19 +02:00
|
|
|
[On Button Event](/reference/input/on-button-event), [onGesture](/reference/input/on-gesture),
|
|
|
|
[On Pin Event](/reference/input/on-pin-event),
|
|
|
|
[buttonIsPressed](/reference/input/button-is-pressed), [pinIsPressed](/reference/input/pin-is-pressed),
|
2019-12-02 05:58:26 +01:00
|
|
|
[is gesture](/reference/input/is-gesture),
|
2022-08-10 18:36:19 +02:00
|
|
|
[compassHeading](/reference/input/compass-heading), [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),
|
|
|
|
[calibrate-compass](/reference/input/calibrate-compass)
|