module main variables pattern dummy script 79 66 { whenButtonPressed 'A' if (pattern < 5) { pattern += 1 } else { pattern = 0 } sendBroadcastSimple pattern } script 315 279 { whenBroadcastReceived '1' sayIt 1 dummy = (digitalReadOp 0) digitalWriteOp 1 true digitalWriteOp 2 false } script 52 279 { whenBroadcastReceived '0' sayIt 0 dummy = (digitalReadOp 0) digitalWriteOp 1 false digitalWriteOp 2 true } script 329 419 { whenBroadcastReceived '3' sayIt 3 digitalWriteOp 0 false dummy = (digitalReadOp 1) digitalWriteOp 2 true } script 60 420 { whenBroadcastReceived '2' sayIt 2 digitalWriteOp 0 true dummy = (digitalReadOp 1) digitalWriteOp 2 false } script 330 563 { whenBroadcastReceived '5' sayIt 5 digitalWriteOp 0 false digitalWriteOp 1 true dummy = (digitalReadOp 2) } script 50 569 { whenBroadcastReceived '4' sayIt 4 digitalWriteOp 0 true digitalWriteOp 1 false dummy = (digitalReadOp 2) } module 'Basic Sensors' Input spec 'r' '[sensors:tiltX]' 'tilt x' spec 'r' '[sensors:tiltY]' 'tilt y' spec 'r' '[sensors:tiltZ]' 'tilt z' spec 'r' '[sensors:acceleration]' 'acceleration' spec 'r' '[display:lightLevel]' 'light level' spec 'r' '[sensors:temperature]' 'temperature (°C)' module 'LED Display' Output spec ' ' '[display:mbDisplay]' 'display _' 'microbitDisplay' 15237450 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' to displayCharacter s { '[display:mbDrawShape]' ('[display:mbShapeForLetter]' (at 1 s)) }