module main author unknown version 1 0 description '' script 269 45 { whenButtonPressed 'A' '[radio:sendString]' 'a' } script 45 57 { whenStarted '[radio:setGroup]' 1 '[radio:setPower]' 7 setUserLED true forever { if ('[radio:messageReceived]') { sayIt ('[radio:receivedString]') scroll_text ('[radio:receivedString]') } } } script 275 159 { whenButtonPressed 'B' '[radio:sendString]' 'b' } script 814 229 { sayIt ('[radio:receivedString]') } module 'LED Display' Output author MicroBlocks version 1 2 tags pixel matrix led tft description 'Display primitives for the 5x5 LED display on the BBC micro:bit, Calliope mini and M5Atom Matrix. Boards with TFT displays (such as the Citilab ED1 or the M5Stack family) also support this primitives in a simulated "fat pixel" display.' variables _stop_scrolling_text spec ' ' '[display:mbDisplay]' 'display _' 'microbitDisplay' 15237440 spec ' ' '[display:mbDisplayOff]' 'clear display' spec ' ' '[display:mbPlot]' 'plot x _ y _' 'num num' 3 3 spec ' ' '[display:mbUnplot]' 'unplot x _ y _' 'num num' 3 3 spec ' ' 'displayCharacter' 'display character _' 'str' 'A' spec ' ' 'scroll_text' 'scroll text _ : pausing _ ms' 'str num' 'HELLO ROSA!' 100 spec ' ' 'stopScrollingText' 'stop scrolling' to displayCharacter s { s = ('[data:join]' '' s) if ((size s) == 0) { '[display:mbDisplayOff]' return 0 } '[display:mbDrawShape]' ('[display:mbShapeForLetter]' (at 1 s)) } to scroll_text text optionalDelay { text = ('[data:join]' text '') delay = 100 if ((pushArgCount) > 1) { delay = optionalDelay } _stop_scrolling_text = (booleanConstant false) local 'length' (size text) for position ((length * 6) + 6) { if _stop_scrolling_text {return 0} for i length { '[display:mbDrawShape]' ('[display:mbShapeForLetter]' ('[data:unicodeAt]' i text)) (((i * 6) + 2) - position) 1 } waitMillis delay } } to stopScrollingText { _stop_scrolling_text = (booleanConstant true) waitMillis 10 '[display:mbDisplayOff]' } module Radio Comm author MicroBlocks version 1 1 tags radio communication messaging network description 'Send and receive messages between micro:bit boards via their built-in radio system.' spec ' ' '[radio:sendInteger]' 'radio send number _' 'num' 123 spec ' ' '[radio:sendString]' 'radio send string _' 'str' 'Hello!' spec ' ' '[radio:sendPair]' 'radio send pair _ = _' 'str num' 'light' 10 spec 'r' '[radio:messageReceived]' 'radio message received?' spec 'r' '[radio:receivedInteger]' 'radio last number' spec 'r' '[radio:receivedString]' 'radio last string' spec ' ' '[radio:setGroup]' 'radio set group _ (0-255)' 'num' 0 spec ' ' '[radio:setPower]' 'radio set power (0-7) _' 'num' 4 spec 'r' '_receivedMessageType' '_radio last message type' spec ' ' '_setChannel' '_radio set channel (0-83) _' 'num' 7 spec 'r' '_signalStrength' '_radio last signal strength' to '_receivedMessageType' { return ('[radio:receivedMessageType]') } to '_setChannel' channel { '[radio:setChannel]' channel } to '_signalStrength' { return ('[radio:signalStrength]') }