My son, like many Year 7 students, received his BBC micro:bit this week, a tiny little PCB with a surprising amount of functionality, intended to get kids coding.
I like the idea behind it, it’s much more self-contained than a Raspberry Pi and has a 5×5 array of LED’s that can be used to display scrolling messages or anything else you can get within the confines of 25 LED’s. Kids can get a ‘Hello World’ style app up and running in seconds.
My son has jumped straight into the Python side of things, which makes me very happy as it’s closest to the sort of coding he might end up doing on a PC or other device.
I’ve been having a little play with it today and we’ve coded up a quick ‘spirit level’ style app that shows if the micro:bit is level or displays an arrow to show which way it’s tilting, using its inbuilt accelerometer. You can change the sensitivity of the unit, by changing the sensitivity variable; setting it to very low values will require a very steady hand to hold it level. It seems that the values from the accelerometer are scaled -1024 to 1024 from my brief experiments.
Anyway, thought I’d stick the code up here in case anyone fancies trying something a bit beyond the ‘Hello World’ code with their child.