microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
43 stars 24 forks source link

Music and LCD problem #25

Closed crouse12 closed 3 years ago

crouse12 commented 3 years ago

Please watch the following code. image I found that music will play after LED screen show 'Hello, World!'. I want they play at the same time. Is it possible?

microbit-carlos commented 3 years ago

Hi @crouse12, You can use the wait argument in scroll to do that: display.scroll('Hello, World!', wait=False) https://microbit-micropython.readthedocs.io/en/latest/display.html

crouse12 commented 3 years ago

Thanks for your help. I will test it. Can music.play execute in the background, too? I try to use micropython to create scratch 3.0 blocks for microbit v2 now. music.play and display.scroll usually make some mistakes for my scrath 3.0 blocks, when i read movement and gestures at the same time. https://www.youtube.com/watch?v=hKWrgvlkIow&t=6s

microbit-carlos commented 3 years ago

https://microbit-micropython.readthedocs.io/en/latest/music.html#music.play

Although there is some undergoing work right now with all the sound-generating stuff and some things might not work yet.

crouse12 commented 3 years ago

Thanks. I will wait them.

microbit-carlos commented 3 years ago

This should be working in the latest https://python.microbit.org/v/beta (beta.7). If you find any issues could you let us know by opening new bug reports? Thanks!

crouse12 commented 3 years ago

This should be working in the latest https://python.microbit.org/v/beta (beta.7). If you find any issues could you let us know by opening new bug reports? Thanks!

The latest python editor solves this problem. Thanks.