Skip to content

With V2, music.play(pin=pin1) permanently overrides pin0 default  #69

@martinwork

Description

@martinwork

Testing with Editor Version: 2.2.0-beta.5; MicroPython Version: 1.0.1/2.0.0-beta.5

With V1 specifying the pin only affects the current instruction.
With V2 subsequent instructions use pin1. It's possible to change to pin2, and back to pin1, but not pin0.

With V2, the code below stops looping, usually within a minute or so.

import microbit
from microbit import *
import music

while True:
    microbit.display.scroll('0')
    music.play(music.JUMP_UP)
    sleep(1000)
    
    microbit.display.scroll('1')
    music.play(music.JUMP_UP, pin=pin1)
    sleep(1000)
    
    microbit.display.scroll('0')
    music.play(music.JUMP_UP)
    sleep(1000)

    microbit.display.scroll('0')
    music.play(music.JUMP_UP, pin=pin0)
    sleep(1000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions