2019-12-02 05:58:26 +01:00
|
|
|
# set Transmit Power
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2016-11-02 01:44:37 +01:00
|
|
|
Make the ``radio`` signal of the @boardname@ stronger or weaker.
|
2019-12-02 05:58:26 +01:00
|
|
|
|
|
|
|
```sig
|
|
|
|
radio.setTransmitPower(7);
|
|
|
|
```
|
|
|
|
|
|
|
|
The signal can be as weak as `0` and as strong as `7`. Default is ``6``.
|
2016-06-03 02:08:09 +02:00
|
|
|
|
|
|
|
The scientific name for the strength of the ``radio`` signal is
|
|
|
|
**dBm**, or **decibel-milliwatts**. A signal strength of `0`
|
|
|
|
can be measured as -30 dBm, and a strength of `7` can be
|
|
|
|
measured as +4 dBm.
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Range
|
2016-10-25 01:30:21 +02:00
|
|
|
|
2016-11-02 01:44:37 +01:00
|
|
|
If your @boardname@ is sending with a strength of `7`, and you are in
|
|
|
|
an open area without many other computers around, the @boardname@ signal
|
2016-06-03 02:08:09 +02:00
|
|
|
can reach as far as 70 meters (about 230 feet).
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Parameters
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
* ``power`` is a [number](/types/number) between ``0`` and ``7`` that means how strong the signal is.
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Simulator
|
2016-06-10 00:30:47 +02:00
|
|
|
|
2016-11-02 01:44:37 +01:00
|
|
|
This function only works on the @boardname@, not in browsers.
|
2016-06-10 00:30:47 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Example
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2016-06-03 02:08:09 +02:00
|
|
|
This program makes the ``radio`` send at full strength.
|
2016-05-25 02:40:01 +02:00
|
|
|
|
|
|
|
```blocks
|
|
|
|
radio.setTransmitPower(7)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See also
|
2016-05-25 02:40:01 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
[received packet](/reference/radio/received-packet),
|
2016-10-25 01:30:21 +02:00
|
|
|
[send number](/reference/radio/send-number),
|
|
|
|
[send value](/reference/radio/send-value),
|
|
|
|
[send string](/reference/radio/send-string)
|
2016-08-09 17:28:08 +02:00
|
|
|
|
|
|
|
```package
|
2016-10-23 06:29:31 +02:00
|
|
|
radio
|
2016-08-09 17:28:08 +02:00
|
|
|
```
|