From d6cc95112c643e10c46cc217be0335330a96c59a Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 10 Nov 2016 13:08:45 -0800 Subject: [PATCH] AnalogPin.P0 not supported --- docs/reference/pins.md | 12 ++++++------ docs/reference/pins/analog-read-pin.md | 2 +- docs/reference/pins/analog-set-period.md | 6 +++--- docs/reference/pins/analog-set-pitch-pin.md | 4 ++-- docs/reference/pins/analog-write-pin.md | 4 ++-- docs/reference/pins/map.md | 2 +- docs/reference/pins/servo-set-pulse.md | 2 +- docs/reference/pins/servo-write-pin.md | 8 ++++---- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/reference/pins.md b/docs/reference/pins.md index d3696892..1887499e 100644 --- a/docs/reference/pins.md +++ b/docs/reference/pins.md @@ -5,23 +5,23 @@ Control currents in Pins for analog/digital signals, servos, i2c, ... ```cards pins.digitalReadPin(DigitalPin.P0); pins.digitalWritePin(DigitalPin.P0, 0); -pins.analogReadPin(AnalogPin.P0); -pins.analogWritePin(AnalogPin.P0, 1023); -pins.analogSetPeriod(AnalogPin.P0, 20000); +pins.analogReadPin(AnalogPin.P1); +pins.analogWritePin(AnalogPin.P1, 1023); +pins.analogSetPeriod(AnalogPin.P1, 20000); pins.map(0, 0, 1023, 0, 4); pins.onPulsed(DigitalPin.P0, PulseValue.High, () => { }); pins.pulseDuration(); pins.pulseIn(DigitalPin.P0, PulseValue.High); -pins.servoWritePin(AnalogPin.P0, 180); -pins.servoSetPulse(AnalogPin.P0, 1500); +pins.servoWritePin(AnalogPin.P1, 180); +pins.servoSetPulse(AnalogPin.P1, 1500); pins.i2cReadNumber(0, NumberFormat.Int8LE); pins.i2cWriteNumber(0, 0, NumberFormat.Int8LE); pins.spiWrite(0); pins.setPull(DigitalPin.P0, PinPullMode.PullDown); pins.analogPitch(0, 0); -pins.analogSetPitchPin(AnalogPin.P0); +pins.analogSetPitchPin(AnalogPin.P1); ``` ### See Also diff --git a/docs/reference/pins/analog-read-pin.md b/docs/reference/pins/analog-read-pin.md index f8e1211f..cce390d6 100644 --- a/docs/reference/pins/analog-read-pin.md +++ b/docs/reference/pins/analog-read-pin.md @@ -4,7 +4,7 @@ Read an **analog** signal (`0` through `1023`) from the [pin](/device/pins) you say. ```sig -pins.analogReadPin(AnalogPin.P0) +pins.analogReadPin(AnalogPin.P1) ``` ### Parameters diff --git a/docs/reference/pins/analog-set-period.md b/docs/reference/pins/analog-set-period.md index 0624c7a2..ac38e6fb 100644 --- a/docs/reference/pins/analog-set-period.md +++ b/docs/reference/pins/analog-set-period.md @@ -5,7 +5,7 @@ analog [pin](/device/pins). Before you call this function, you should set the specified pin as analog. ```sig -pins.analogSetPeriod(AnalogPin.P0, 20000) +pins.analogSetPeriod(AnalogPin.P1, 20000) ``` ### Parameters @@ -17,8 +17,8 @@ The following code first sets `P0` to analog with **analog write pin**, and then sets the PWM period of `P0` to 20,000 microseconds. ```blocks -pins.analogWritePin(AnalogPin.P0, 512) -pins.analogSetPeriod(AnalogPin.P0, 20000) +pins.analogWritePin(AnalogPin.P1, 512) +pins.analogSetPeriod(AnalogPin.P1, 20000) ``` ### See also diff --git a/docs/reference/pins/analog-set-pitch-pin.md b/docs/reference/pins/analog-set-pitch-pin.md index 0aeac3f9..ca861947 100644 --- a/docs/reference/pins/analog-set-pitch-pin.md +++ b/docs/reference/pins/analog-set-pitch-pin.md @@ -3,7 +3,7 @@ Specify which [pin](/device/pins) (P0, P1, P2) is used to generate tones. ```sig -pins.analogSetPitchPin(AnalogPin.P0) +pins.analogSetPitchPin(AnalogPin.P1) ``` ### Parameters @@ -13,7 +13,7 @@ pins.analogSetPitchPin(AnalogPin.P0) ### Example ```blocks -pins.analogSetPitchPin(AnalogPin.P0) +pins.analogSetPitchPin(AnalogPin.P1) let frequency = 440 let duration = 1000 pins.analogPitch(frequency, duration) diff --git a/docs/reference/pins/analog-write-pin.md b/docs/reference/pins/analog-write-pin.md index c7fdca9a..483c3dc1 100644 --- a/docs/reference/pins/analog-write-pin.md +++ b/docs/reference/pins/analog-write-pin.md @@ -4,7 +4,7 @@ Write an **analog** signal (`0` through `1023`) to the [pin](/device/pins) you say. ```sig -pins.analogWritePin(AnalogPin.P0, 400) +pins.analogWritePin(AnalogPin.P1, 400) ``` ### Parameters @@ -17,7 +17,7 @@ pins.analogWritePin(AnalogPin.P0, 400) This program writes `1023` to pin `P0`. ```blocks -pins.analogWritePin(AnalogPin.P0, 1023) +pins.analogWritePin(AnalogPin.P1, 1023) ``` #### ~hint diff --git a/docs/reference/pins/map.md b/docs/reference/pins/map.md index d2b22cf2..ada4f0be 100644 --- a/docs/reference/pins/map.md +++ b/docs/reference/pins/map.md @@ -28,7 +28,7 @@ This example maps the value read from the analog pin `P0` to an LED coordinate between `0` and `4`. ```blocks -let value1 = pins.analogReadPin(AnalogPin.P0) +let value1 = pins.analogReadPin(AnalogPin.P1) let index = pins.map(value1, 0, 1023, 0, 4) led.plot(0, index) ``` diff --git a/docs/reference/pins/servo-set-pulse.md b/docs/reference/pins/servo-set-pulse.md index 0bf38e10..7fe17aba 100644 --- a/docs/reference/pins/servo-set-pulse.md +++ b/docs/reference/pins/servo-set-pulse.md @@ -17,7 +17,7 @@ pins.servoSetPulse(AnalogPin.P1, 1500) The following code sets the servo pulse to `1000` microseconds. ```blocks -pins.servoSetPulse(AnalogPin.P0, 1000) +pins.servoSetPulse(AnalogPin.P1, 1000) ``` ### See also diff --git a/docs/reference/pins/servo-write-pin.md b/docs/reference/pins/servo-write-pin.md index db2ccb41..7a0683fa 100644 --- a/docs/reference/pins/servo-write-pin.md +++ b/docs/reference/pins/servo-write-pin.md @@ -9,7 +9,7 @@ full speed in one direction, `180` specifies full speed in the other, and approximately `90` specifies no movement.) ```sig -pins.servoWritePin(AnalogPin.P0, 180) +pins.servoWritePin(AnalogPin.P1, 180) ``` ### Parameters @@ -22,7 +22,7 @@ pins.servoWritePin(AnalogPin.P0, 180) #### Setting the shaft angle to midpoint on a servo ```blocks -pins.servoWritePin(AnalogPin.P0, 90) +pins.servoWritePin(AnalogPin.P1, 90) ``` #### Controlling the shaft by using the tilt information of the accelerometer @@ -32,14 +32,14 @@ basic.forever(() => { let millig = input.acceleration(Dimension.X) // map accelerometer readings to angle let angle = pins.map(millig, -1023, 1023, 0, 180) - pins.servoWritePin(AnalogPin.P0, angle) + pins.servoWritePin(AnalogPin.P1, angle) }) ``` #### Setting the full speed on a continuous servo ```blocks -pins.servoWritePin(AnalogPin.P0, 0) +pins.servoWritePin(AnalogPin.P1, 0) ``` ### See also