radio.onReceivedNumber(function (receivedNumber) { if (receivedNumber == 1) { pins.digitalWritePin(DigitalPin.P0, 1) led.plot(2, 1) led.plot(1, 2) led.plot(2, 2) led.plot(3, 2) led.plot(2, 3) } else { pins.digitalWritePin(DigitalPin.P0, 0) led.unplot(2, 1) led.unplot(1, 2) led.unplot(2, 2) led.unplot(3, 2) led.unplot(2, 3) } }) radio.setGroup(1) basic.forever(function () { if (pins.digitalReadPin(DigitalPin.P1) == 1) { radio.sendNumber(1) led.plot(2, 1) led.plot(1, 2) led.plot(2, 2) led.plot(3, 2) led.plot(2, 3) } else { radio.sendNumber(0) led.unplot(2, 1) led.unplot(1, 2) led.unplot(2, 2) led.unplot(3, 2) led.unplot(2, 3) } })