pxt-calliope/docs/reference/input.md
Galen Nickel fa37f1fac0 Batch of fixes from the Lancaster doc review (#451)
* Local commit.

* local commit

* Doc fixes from Lancaster review.

* I don't want to change these yet.

* Trailing newlines, arrr.

* Get the 'Game' cards setup.

* Take block support off of 'show animation'.

* Add 'see also' for showArrow().
2017-07-24 13:40:36 -07:00

1.2 KiB

Input

Events and data from sensors

input.onButtonPressed(Button.A, () => {
    
});
input.onGesture(Gesture.Shake, () => {
    
});
input.onPinPressed(TouchPin.P0, () => {
    
});
input.buttonIsPressed(Button.A);
input.compassHeading();
input.pinIsPressed(TouchPin.P0);
input.temperature();
input.acceleration(Dimension.X);
input.lightLevel();
input.rotation(Rotation.Pitch);
input.magneticForce(Dimension.X);
input.runningTime();
input.setAccelerometerRange(AcceleratorRange.OneG);

See also

onButtonPressed, onGesture, onPinPressed, buttonIsPressed, compassHeading, pinIsPressed, temperature, acceleration, lightLevel, rotation, magneticForce, runningTime, setAccelerometerRange, calibrate-compass