pxt-arcade icon indicating copy to clipboard operation
pxt-arcade copied to clipboard

edge connector blocks freeze code

Open PhilAtKitronik opened this issue 3 years ago • 19 comments

Describe the bug edge connection extension blocks freezes code

To Reproduce import the edge connection blocks in to arcade for using the pins from BBC micro:bit The test code I was using was as follows

controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
    pins.P2.digitalWrite(true)
    pause(500)
    pins.P2.digitalWrite(false)
    pause(500)
})
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
    music.baDing.play()
})
let mySprite = sprites.create(img`
    . . . . . . . . . . b 5 b . . . 
    . . . . . . . . . b 5 b . . . . 
    . . . . . . b b b b b b . . . . 
    . . . . . b b 5 5 5 5 5 b . . . 
    . . . . b b 5 d 1 f 5 5 d f . . 
    . . . . b 5 5 1 f f 5 d 4 c . . 
    . . . . b 5 5 d f b d d 4 4 . . 
    . b b b d 5 5 5 5 5 4 4 4 4 4 b 
    b d d d b b d 5 5 4 4 4 4 4 b . 
    b b d 5 5 5 b 5 5 5 5 5 5 b . . 
    c d c 5 5 5 5 d 5 5 5 5 5 5 b . 
    c b d c d 5 5 b 5 5 5 5 5 5 b . 
    . c d d c c b d 5 5 5 5 5 d b . 
    . . c b d d d d d 5 5 5 b b . . 
    . . . c c c c c c c c b b . . . 
    . . . . . . . . . . . . . . . . 
    `, SpriteKind.Player)
forever(function () {
    controller.moveSprite(mySprite, 100, 100)
})

The sprite moves around, buzzer beeps when button A is pressed. on pin2 we have a small motor controlled via a FET. I expected the pin to go high wait and go low, to turn the motor on and off after 500 milliseconds. Once I press button B the code locks up and can not control the sprite or sound the buzzer.

I'm using the digital write high and low blocks as could not find the default pin for the vibrate block with regards to using the micro:bit hardware

PhilAtKitronik avatar Jul 28 '21 13:07 PhilAtKitronik