Update:now updated all to include the Bluetooth module so these can be uploaded to your micro:bit with the (remarkably poor) mobile app. If you don’t include the Bluetooth module (or want to use the Radio module) you lose the ability to program over the air.
Shake temperature in ËšF:
I just picked up a micro:bit, the little educational microprocessor board originally from the BBC. It’s a nice little unit, though like all educational resources, it’s sometimes hard to access resources as a non-edu type.
I landed upon MicroPython, a Python language subset that runs directly on the micro:bit’s ARM chip. I rather like the Mu editor:
To give the old microcontroller grumps something real to complain about, MicroPython includes a bunch of very high-level functions, such as a powerful music and sound module. Getting the sound out is easy: just croc-clip a speaker onto the output pads:
(MicroPython warns against using a piezo buzzer as a speaker, but mine worked fine â€” loudly and supremely annoyingly â€” with a large piezo element. Some piezos have a fixed-frequency oscillator attached, but this simple one was great.)
This trivial example plays the Nyan Cat theme forever, but every time it loops it gets faster. The beats variable starts at the default 120 bpm, but is increased by one every time:
# nyan but it gets faster
beats = 120
beats = beats + 1
This starts out as merely irritating, but quite quickly becomes deeply annoying, and in mere hours become vastly vexing. I’m sure you’d only use this power for good â€¦