Home

Awesome

microbit-video

C++ programs for generating video from a V1 micro:bit.

This is a project created by Kevin Moonlight. You can view his video here https://www.youtube.com/watch?v=uh61FeqduBk and read his code here: https://os.mbed.com/users/yyzkevin/code/microbit-hello-world/

What I've done is add a filled box and compile it into a HEX file so you can easily try it out yourself.

screenshot

What it does

It generates a demo of some boxes, text and a live counter as a black and white NTSC video image you can view on a TV.

What you need to try it out

wiring photo

How to build it

This works much better for me with the micro:bit powered off batteries. If I powered it off the TV's USB socket or a mains socket on the same earth ring as the TV, the contrast was very poor. I'm grateful for Dave Ames in suggesting a ground loop is probably to blame: https://en.wikipedia.org/wiki/Ground_loop_(electricity)

I'm also grateful to @WiFiSheep for suggesting putting a 1k resistor in line with the red wire from pin 1 in this diagram, this seems to cure the ground loop issue.

wiring diagram

How to modify and recompile the code

Not that easy. What I did was go to https://ide.mbed.com/, log in, I dragged Kevin's original 3 files into a new project:

I tinkered with the code in the Mbed IDE, clicked compile to get a HEX file I could drag and drop on to a V1 micro:bit's MICROBIT drive.

Can I write a program to do this in Python or MakeCode?

Short answer: no. Slightly longer answer: not easily, because generating video signals requires very precise timings which you can't access in MakeCode. In Python you'd need to use machine code I think. Maybe someone could make this into an extension? That would be cool.

What use is this?

Not a huge amount on its own, but I think getting video from a micro:bit is pretty cool. You can read about how to turn a V1 micro:bit and a PS/2 keyboard into a programmable computer here: http://www.suppertime.co.uk/blogmywiki/2021/05/video-from-a-microbit/

Custom font

Have a look at the wide font demo - I added a custom font because I could. custom font demo

Next steps