I am now the proud owner of a micro:bit. Yippee! I'm a bit old to be running around shouting "Yippee!" really, but why shouldn't us oldies have a bit of fun too.
Over on this thread,
jlucas suggested connecting an 8 ohm speaker to one of the IO pins. Instinctively, I flinched: 3.3V into 8 ohms would be a current of 413mA [if the IO pin could hold up under the strain, which it wouldn't - "Cap'n, the IO pins, they cannae take the strain"]. That would far exceed the absolute
maximum for the pin. Now that I have a micro:bit of my own I can see for myself, and the good news is that you can safely connect an 8 ohm loudspeaker. The pins have a 220 ohm resistor in series with them.
Here's a picture of my micro:bit driving a small speaker.
And here is the waveform across the speaker
We'd expect the amplitude to be 116mV. 8/(220+8) x 3.3V. It's slightly less than that because the IO driver (inside the chip) isn't a perfect switch and has some resistance too which adds to the 220 outside the chip.
The current is a modest 15mA (calculation: I didn't measure it) and the dissipation in the speaker would be a mere 1.8mW.
There's also a weak pull-up resistor at the edge connector, but that's difficult to measure accurately in circuit.
Sorry about all this - I'm doing electronics when I should be learning to code (old habits die hard). Now where's that Python book got to...