pxt-calliope/docs/reference/pins.md

23 lines
632 B
Markdown
Raw Normal View History

2016-04-05 22:23:42 +02:00
# Pins
2016-05-05 20:16:14 +02:00
Control currents in Pins for analog/digital signals, servos, i2c, ...
2016-04-05 22:23:42 +02:00
```cards
2016-04-05 22:54:48 +02:00
pins.digitalReadPin(DigitalPin.P0);
pins.digitalWritePin(DigitalPin.P0, 0);
pins.analogReadPin(AnalogPin.P0);
pins.analogWritePin(AnalogPin.P0, 1023);
pins.analogSetPeriod(AnalogPin.P0, 20000);
2016-05-27 17:55:40 +02:00
pins.map(0, 0, 1023, 0, 4);
2016-05-17 07:18:58 +02:00
pins.onPulsed(DigitalPin.P0, PulseValue.High, () => {
});
pins.pulseDuration();
2016-04-05 22:54:48 +02:00
pins.servoWritePin(AnalogPin.P0, 180);
pins.servoSetPulse(AnalogPin.P0, 1500);
2016-05-17 07:18:58 +02:00
pins.i2cReadNumber(0, NumberFormat.Int8LE);
pins.i2cWriteNumber(0, 0, NumberFormat.Int8LE);
2016-04-05 22:23:42 +02:00
pins.analogPitch(0, 0);
2016-04-05 22:54:48 +02:00
pins.analogSetPitchPin(AnalogPin.P0);
2016-04-05 22:23:42 +02:00
```