Enable the slider for a number of apis. (#367)

This commit is contained in:
Sam El-Husseini
2017-03-03 23:39:42 -08:00
committed by GitHub
parent df95a6441b
commit 87f1580061
8 changed files with 29 additions and 10 deletions

View File

@ -14,7 +14,8 @@
"radio.sendValue": "Broadcasts a name / value pair along with the device serial number\nand running time to any connected micro:bit in the group.",
"radio.sendValue|param|name": "the field name (max 12 characters), eg: \"name\"",
"radio.sendValue|param|value": "the numberic value",
"radio.setGroup": "Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.\n@ param id the group id between ``0`` and ``255``, 1 eg",
"radio.setGroup": "Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.",
"radio.setGroup|param|id": "the group id between ``0`` and ``255``, eg: 1",
"radio.setTransmitPower": "Change the output power level of the transmitter to the given value.",
"radio.setTransmitPower|param|power": "a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7",
"radio.setTransmitSerialNumber": "Set the radio to transmit the serial number in each message.",

View File

@ -314,11 +314,12 @@ namespace radio {
/**
* Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.
* @ param id the group id between ``0`` and ``255``, 1 eg
* @param id the group id between ``0`` and ``255``, eg: 1
*/
//% help=radio/set-group
//% weight=10 blockGap=8
//% blockId=radio_set_group block="radio set group %ID"
//% id.min=0 id.max=255
void setGroup(int id) {
if (radioEnable() != MICROBIT_OK) return;
uBit.radio.setGroup(id);
@ -331,6 +332,7 @@ namespace radio {
//% help=radio/set-transmit-power
//% weight=9 blockGap=8
//% blockId=radio_set_transmit_power block="radio set transmit power %power"
//% power.min=0 power.max=7
//% advanced=true
void setTransmitPower(int power) {
if (radioEnable() != MICROBIT_OK) return;

View File

@ -95,11 +95,12 @@ declare namespace radio {
/**
* Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.
* @ param id the group id between ``0`` and ``255``, 1 eg
* @param id the group id between ``0`` and ``255``, eg: 1
*/
//% help=radio/set-group
//% weight=10 blockGap=8
//% blockId=radio_set_group block="radio set group %ID" shim=radio::setGroup
//% blockId=radio_set_group block="radio set group %ID"
//% id.min=0 id.max=255 shim=radio::setGroup
function setGroup(id: number): void;
/**
@ -109,6 +110,7 @@ declare namespace radio {
//% help=radio/set-transmit-power
//% weight=9 blockGap=8
//% blockId=radio_set_transmit_power block="radio set transmit power %power"
//% power.min=0 power.max=7
//% advanced=true shim=radio::setTransmitPower
function setTransmitPower(power: number): void;