Skip to content

Commit da534be

Browse files
Upgrade notes.
1 parent 75cabcc commit da534be

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ Otherwise, the user will need to use <code>radio.receive_bytes</code> or <code>r
268268

269269
</table>
270270

271+
## Upgrading micropython-microbit-v2
272+
273+
1. Update the lib/micropython-microbit-v2 to the relevant hash. Make sure that its lib/micropython submodule is up-to-date.
274+
2. Review the full diff for micropython-microbit-v2. In particular, note changes to:
275+
1. main.c, src/Makefile and mpconfigport.h all which have simulator versions that may need updates
276+
2. the HAL, which may require implementing in the simulator
277+
3. the filesystem, which has a JavaScript implementation.
278+
271279
## Web Assembly debugging
272280

273281
Steps for WASM debugging in Chrome:

src/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ SRC_C += \
5959
main.c \
6060
mphalport.c \
6161

62-
# Upgrading?
63-
# Compare to lib/micropython-microbit-v2/src/codal_port/Makefile
6462
SRC_C += $(addprefix $(CODAL_PORT)/, \
6563
drv_display.c \
6664
drv_image.c \

src/examples/sound_effects_builtin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from microbit import *
2+
3+
# You don't hear this one because we don't wait then play another which stops this one.
4+
display.show(Image.HAPPY)
5+
audio.play(Sound.GIGGLE, wait=False)
6+
audio.play(Sound.GIGGLE)
7+
display.show(Image.SAD) # This doesn't happen until the giggling is over.
8+
audio.play(Sound.SAD)

src/examples/sound_effects_user.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from microbit import *
2+
3+
# Create a Sound Effect and immediately play it
4+
audio.play(
5+
audio.SoundEffect(
6+
freq_start=400,
7+
freq_end=2000,
8+
duration=500,
9+
vol_start=100,
10+
vol_end=255,
11+
wave=audio.SoundEffect.WAVE_TRIANGLE,
12+
fx=audio.SoundEffect.FX_VIBRATO,
13+
shape=audio.SoundEffect.SHAPE_LOG,
14+
)
15+
)

0 commit comments

Comments
 (0)