The BBC micro:bit is a tool for introducing young people to programming. It’s a little embedded computer with a few inputs and a matrix of LEDs for output, as well as some control lines. In principle it’s quite easy to use, I made a 1d6 simulator:
from microbit import *
from random import randint
class Die:
ONE = Image("00000:"
"00000:"
"00900:"
"00000:"
"00000")
TWO = Image("00000:"
"09000:"
"00000:"
"00090:"
"00000")
THREE = Image("00000:"
"09000:"
"00900:"
"00090:"
"00000")
FOUR = Image("00000:"
"09090:"
"00000:"
"09090:"
"00000")
FIVE = Image("00000:"
"09090:"
"00900:"
"09090:"
"00000")
SIX = Image("00000:"
"09090:"
"09090:"
"09090:"
"00000")
ALL = [ONE, TWO, THREE, FOUR, FIVE, SIX]
@classmethod
def throw(self):
return self.ALL[randint(0,5)]
display.show(Die.ALL, delay=100, wait=False, loop=True)
while True:
if button_a.is_pressed():
display.show(Die.throw())
elif button_b.is_pressed():
display.show(Die.ALL, delay=100, wait=False, loop=True)
Simple (I mean, simple if you know what the word randint
means (hint: it means “random integer” as long as you know what an integer is), that programming languages that aren’t Fortran call the first element of an array element zero, even though it’s obviously ONE
as far as a die is concerned, and you’re OK with the word classmethod
).
Here it is in action: woo! I AER PROGRAMMER!!!
And here’s the litany of things I did to get there:
- I opened the “details.txt” file on the micro:bit, which tells me a load of build numbers and flash dates. I don’t know what I’m supposed to do with that. This is hard.
- I opened the “microbit.html” file on the micro:bit, which redirects me to microbit.co.uk, which tells me that as part of the BBC’s restructuring of its online content, I will be redirected to microbit.org. I decided this was probably OK, and ended up looking at the same site but with a different URL (whatever one of those is).
- I clicked on the introductory video and was told that I need an Adobe Flash Player, whatever one of those is.
- I eventually found enough buttons to find a website that is a python editor that lets me write code for my micro:bit, and a tutorial for writing Python for the micro:bit. I know what a python is, but do not know why I would want a snake for my micro:bit.
- The tutorial tells me to use a thing called a “mu”, which is apparently not the website python editor but is another python editor. I do not know what a mu is, but I must download it.
- There are three different download buttons, depending on whether I have a Windows, a Mac, or a Linux, whatever they are.
- If I have a Windows, then I to enable the REPL (whatever that is) I must download a serial driver (whatever that is).
- The driver site tells me that if I have a Windows 10 (whatever that is), then I should not download the serial driver.
- If I have a Mac, then the first time (but maybe not other times, that’s not clear) I open the mu I have to right click it.
- If I have a Linux, then I must
chmod u+x
the mu and make sure my user (isn’t that me?) is in thedialout
(whatever that is) group (whatever that is). - Now I can write my python. To put it on the micro:bit, I must “flash” it. I guess that is because I have an Adobe Flash Player from earlier.
- The micro:bit shows me helpful messages when I get something wrong. It scrolls the message “id=41 SyntaxError: invalid syntax” when I flash my python. I do not know what this means, but I was told that it’s helpful. Therefore I am stupid.
I am not singling out the BBC, the micro:bit makers, the mu creators, Microsoft, or any of the other individuals or organisations involved with creating this easy-to-use educational environment. This is fine. This is how computers work, nay this is how computers work when we are making it easy to work them. This is our industry.
To quote Freddie Mercury: is this the world we created? We made it on our own. Is this the world we devastated, right to the bone? If there’s a God in the sky looking down what can he think of what we’ve done to the world that we created?