pxt-calliope/docs/reference/input.md
Peli de Halleux 81b8b1b69c updated docs
2016-05-05 11:16:14 -07:00

42 lines
687 B
Markdown

# Input
Events and data from sensors
```cards
input.onButtonPressed(Button.A, () => {
});
input.onGesture(Gesture.Shake, () => {
});
input.onPinPressed(TouchPin.P0, () => {
});
input.buttonIsPressed(Button.A);
input.compassHeading();
input.temperature();
input.acceleration(Dimension.X);
input.lightLevel();
input.rotation(Rotation.Pitch);
input.magneticForce(Dimension.X);
input.runningTime();
input.setAccelerometerRange(AcceleratorRange.OneG);
input.pinIsPressed(TouchPin.P0);
input.calibrate();
input.onLogoDown(() => {
});
input.onLogoUp(() => {
});
input.onScreenDown(() => {
});
input.onScreenUp(() => {
});
input.onShake(() => {
});
```