rename micro:bit to @boardname@
This commit is contained in:
@ -27,5 +27,5 @@ pins.analogPitch(frequency1, duration)
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
[@boardname@ pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
|
||||
|
@ -28,13 +28,13 @@ basic.forever(() => {
|
||||
|
||||
#### ~hint
|
||||
|
||||
If you are using **analog read pin** with another micro:bit running **analog write pin**, then things can get tricky. Remember that the micro:bit that runs **analog set pin** writes 0's and 1's at a very high frequency to achieve an average of the desired value. Sadly, if you try to read that average from another micro:bit, then the micro:bit will either read 0 or 1023. You could try to read a higher number of values (e.g. a million) in a loop, then computer then average. Alternatively, you can plug in a capacitor in-between the two micro:bits.
|
||||
If you are using **analog read pin** with another @boardname@ running **analog write pin**, then things can get tricky. Remember that the @boardname@ that runs **analog set pin** writes 0's and 1's at a very high frequency to achieve an average of the desired value. Sadly, if you try to read that average from another @boardname@, then the @boardname@ will either read 0 or 1023. You could try to read a higher number of values (e.g. a million) in a loop, then computer then average. Alternatively, you can plug in a capacitor in-between the two @boardname@s.
|
||||
|
||||
#### ~
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[on pin pressed](/reference/input/on-pin-pressed),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
[digital read pin](/reference/pins/digital-read-pin),
|
||||
|
@ -23,7 +23,7 @@ pins.analogSetPeriod(AnalogPin.P0, 20000)
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[on pin pressed](/reference/input/on-pin-pressed),
|
||||
[analog read pin](/reference/pins/analog-read-pin),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
|
@ -26,5 +26,5 @@ pins.analogPitch(frequency, duration)
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog pitch](/reference/pins/analog-pitch)
|
||||
[@boardname@ pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog pitch](/reference/pins/analog-pitch)
|
||||
|
||||
|
@ -30,5 +30,5 @@ and their average is `256`.
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [on pin pressed](/reference/input/on-pin-pressed), [analog read pin](/reference/pins/analog-read-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
[@boardname@ pins](/device/pins), [on pin pressed](/reference/input/on-pin-pressed), [analog read pin](/reference/pins/analog-read-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Digital Read Pin
|
||||
|
||||
Read a **digital** (`0` or `1`) signal from a [pin](/device/pins) on
|
||||
the micro:bit board.
|
||||
the @boardname@ board.
|
||||
|
||||
```sig
|
||||
pins.digitalReadPin(DigitalPin.P3)
|
||||
@ -43,9 +43,9 @@ basic.forever(() => {
|
||||
```
|
||||
|
||||
This program is a remote control for the score keeper program. If you
|
||||
connect `P1` on the remote control micro:bit to `P0` on the score
|
||||
keeper micro:bit, you can press button `B` on the remote to buzz and
|
||||
make the score bigger on the other micro:bit.
|
||||
connect `P1` on the remote control @boardname@ to `P0` on the score
|
||||
keeper @boardname@, you can press button `B` on the remote to buzz and
|
||||
make the score bigger on the other @boardname@.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
@ -56,13 +56,13 @@ input.onButtonPressed(Button.B, () => {
|
||||
```
|
||||
#### ~hint
|
||||
|
||||
Remember to connect `GND` on both micro:bits together!
|
||||
Remember to connect `GND` on both @boardname@s together!
|
||||
|
||||
#### ~
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[digital write pin](/reference/pins/digital-write-pin),
|
||||
[analog read pin](/reference/pins/analog-read-pin),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Digital Write Pin
|
||||
|
||||
Write a **digital** (`0` or `1`) signal to a [pin](/device/pins) on
|
||||
the micro:bit board.
|
||||
the @boardname@ board.
|
||||
|
||||
```sig
|
||||
pins.digitalWritePin(DigitalPin.P1, 1)
|
||||
@ -40,9 +40,9 @@ basic.forever(() => {
|
||||
```
|
||||
|
||||
This program is a remote control for the score keeper program. If you
|
||||
connect `P1` on the remote control micro:bit to `P0` on the score
|
||||
keeper micro:bit, you can press button `B` on the remote. This program
|
||||
will use ``digital write pin`` to make the other micro:bit buzz and
|
||||
connect `P1` on the remote control @boardname@ to `P0` on the score
|
||||
keeper @boardname@, you can press button `B` on the remote. This program
|
||||
will use ``digital write pin`` to make the other @boardname@ buzz and
|
||||
make the score bigger.
|
||||
|
||||
```blocks
|
||||
@ -55,7 +55,7 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins),
|
||||
[@boardname@ pins](/device/pins),
|
||||
[digital read pin](/reference/pins/digital-read-pin),
|
||||
[analog read pin](/reference/pins/analog-read-pin),
|
||||
[analog write pin](/reference/pins/analog-write-pin),
|
||||
|
@ -10,7 +10,7 @@ pins.onPulsed(DigitalPin.P0, PulseValue.High, () => { });
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``name``: The micro:bit hardware pin to configure (``P0`` through ``P20``)
|
||||
* ``name``: The @boardname@ hardware pin to configure (``P0`` through ``P20``)
|
||||
* ``pulse``: Which state will cause the associated block to execute (**High** or **Low**)
|
||||
|
||||
### Example
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Pulse In
|
||||
|
||||
Returns the duration of a pulse (high or low) from a [pin](/device/pins) on
|
||||
the micro:bit board in microseconds.
|
||||
the @boardname@ board in microseconds.
|
||||
|
||||
```sig
|
||||
pins.pulseIn(DigitalPin.P0, PulseValue.High)
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
Configure the electrical pull of the specified pin.
|
||||
|
||||
Many micro:bit pins can be configured as _pull-ups_. For example, a
|
||||
Many @boardname@ pins can be configured as _pull-ups_. For example, a
|
||||
pull-up can set a pin's voltage to high (3.3 volts, or `1` when
|
||||
calling [digital read pin](/reference/pins/digital-read-pin)). If one
|
||||
end of a button is connected to ``P0`` (set to high) and the other end
|
||||
is connected to ``GND`` (0 volts), then when you press the button,
|
||||
``P0`` is driven to 0 volts, and the micro:bit software can detect a
|
||||
``P0`` is driven to 0 volts, and the @boardname@ software can detect a
|
||||
button press.
|
||||
|
||||
```sig
|
||||
@ -16,7 +16,7 @@ pins.setPull(DigitalPin.P9, PinPullMode.PullDown);
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``name``: The micro:bit hardware pin to configure (``P0``-``P20``)
|
||||
* ``name``: The @boardname@ hardware pin to configure (``P0``-``P20``)
|
||||
* ``pull``: The pull to which to set the pin (**down**, **up**, or **none**)
|
||||
|
||||
### Example
|
||||
|
Reference in New Issue
Block a user