explictely set radio default power to 6 (#1286)

This commit is contained in:
Peli de Halleux 2018-09-24 10:16:03 -07:00 committed by GitHub
parent 465d83637f
commit eed66868a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# set Transmit Power # set Transmit Power
Make the ``radio`` signal of the @boardname@ stronger or weaker. It can be as weak as `0` and as strong as `7`. Make the ``radio`` signal of the @boardname@ stronger or weaker. It can be as weak as `0` and as strong as `7`. Default is ``6``.
The scientific name for the strength of the ``radio`` signal is The scientific name for the strength of the ``radio`` signal is
**dBm**, or **decibel-milliwatts**. A signal strength of `0` **dBm**, or **decibel-milliwatts**. A signal strength of `0`

View File

@ -53,6 +53,7 @@ namespace radio {
} }
if (!radioEnabled) { if (!radioEnabled) {
uBit.radio.setGroup(pxt::programHash()); uBit.radio.setGroup(pxt::programHash());
uBit.radio.setTransmitPower(6); // start with high power by default
radioEnabled = true; radioEnabled = true;
} }
return r; return r;

View File

@ -60,6 +60,7 @@ namespace pxsim {
constructor(private runtime: Runtime) { constructor(private runtime: Runtime) {
this.datagram = new RadioDatagram(runtime); this.datagram = new RadioDatagram(runtime);
this.power = 6; // default value
} }
setTransmitPower(power: number) { setTransmitPower(power: number) {