microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
727 stars 638 forks source link

radio examples like chuck-a-duck broken in beta simulator #5243

Closed jaustin closed 1 year ago

jaustin commented 1 year ago

Describe the bug The radio chuck-a-duck program doesn't work on /beta on the simulator, as far as I can see

I notice that there's a change in when the simulator appears between live and beta.

Take this program:

image

Normally this will allow you to try 'chuck-a-duck' in the simulator, however in the current /beta the radio message never appears to be received by the 'top' micro:bit

Here's the simulator on /beta beta sim radio broken

Here's the simulator on live (working) live sim radio working

cc @abchatra this is a very common/popular example commonly used as a live demo

microbit-carlos commented 1 year ago

I can confirm I can replicate this issue on /beta:

makecode.microbit.org version: 6.0.1 Microsoft MakeCode version: 8.6.52 microbit runtime version: v2.2.0-rc6 codal-microbit-v2 runtime version: v0.2.54

radio.onReceivedNumber(function (receivedNumber) {
    basic.showIcon(IconNames.Duck)
})
input.onGesture(Gesture.Shake, function () {
    basic.clearScreen()
    radio.sendNumber(1)
})
radio.setGroup(1)
abchatra commented 1 year ago

@jwunderl regression from your change to spin the simulator early?

jwunderl commented 1 year ago

Here's a build with the fix https://makecode.microbit.org/app/236b7dcde6814d1fbd2f8e18abb75020fa5fabae-97e51189ad#pub:S38404-96542-17447-26597

jaustin commented 1 year ago

I can confirm that this fix works for me too