microsoft / microbit-robot

Universal Robot blocks for MakeCode micro:bit - beta
https://makecode.microbit.org/pkg/microsoft/microbit-robot
MIT License
15 stars 19 forks source link

unhandled exception #58

Open tballmsft opened 9 months ago

tballmsft commented 9 months ago

Add robot extension to MakeCode and create this program (https://makecode.microbit.org/_PEqVT5VRaXzb):

robot.setRadioGroup(1)
robot.elecfreaksCuteBot.start()

See following error in console:

pxtapp.js:1  unhandled exception: Add 'robot start ...' block in the 'on start' block
   at instance (pxt_modules/microbit-robot/robotdriver.ts:47:9)
   at setRadioGroup (pxt_modules/microbit-robot/blocks.ts:256:5)
   at <main> (pxt_modules/ws2812b/main.ts:1:1)
tballmsft commented 9 months ago

This error doesn't occur when the setRadioGroup statement is removed or placed after the start function.