本代码用于测试不同信号强度下的发信距离。
radio.onReceivedNumber(function (receivedNumber) {
basic.showNumber(radio.receivedPacket(RadioPacketProperty.SignalStrength))
})
input.onButtonPressed(Button.A, function () {
basic.showString("A")
})
input.onButtonPressed(Button.B, function () {
basic.showString("B")
})
basic.showIcon(IconNames.Yes)
Code language: JavaScript (javascript)