Category Archives: Computer Science education

BBC Microbit – First impressions

For the past few weeks, I have been playing with a developer version of the BBC’s new Microbit device. Below are my first impressions of the hardware and software.

The second part of this series, focusing on MicroPython on Microbit can be found here.

The what?

The BBC Microbit is a tiny circuit board with an onboard Arduino-like microprocessor and a number of sensors built in along with a 5×5 red LED matrix..
Every year 7 (year 8 in Northern Ireland) student across the UK will be receiving one for free as part of the BBC’s Make It Digital programme. Right now, the current expected rollout is that teachers will receive devices late February 2016 while students will receive theirs a few months later.

The Microbit circuit board includes

  • A 5×5 red LED matrix
  • 2 buttons (and another reset button on the back)
  • A compass and accelerometer
  • An edge connector with 22 pins (16 of which are usable GPIO pins)
  • Micro USB port for programming/power
  • 2 pin JST port for powering from 3V battery (x2 AAA batteries for example)
The front of the Microbit has its 5x5 red LED matrix, 2 buttons and a marked edge connector.
The front of the Microbit has its 5×5 red LED matrix, 2 buttons and a marked edge connector.

Programming

Hardware like this though is no use without a way to program it.

There are currently 4 different ways to write code for the Microbit, 3 of which are right now, entirely web based.

  1. Microsoft Touch Develop (online)
  2. Microsoft Block Editor (online)
  3. Code Kingdoms Javascript editor (online)
  4. MicroPython (online soon and offline)

The first thing worth pointing out is there is currently 2 ways to actually load your programs onto your Microbit.

  1. If using a computer with a USB port, download a .hex file and copy the file onto the “MICROBIT” flash drive that appears when you plug the device in (so no special drivers needed).
  2. If using a tablet or phone (iOS or Android is fine), you will be able to download your programs over bluetooth to the Microbit. I have seen a working demo of this at BETT 2016 for Android, although as of yet have not seen anything working with iOS.

All the programming environment are listed here.

Microsoft TouchDevelop

A simple script to show a smiley face when shaken.
A simple script to show a smiley face when shaken for 1 second.

The first is Microsoft TouchDevelop. A project initially born out of Microsoft Research, TouchDevelop is an interesting environment for writing code, without actually needing a keyboard… It is very weird coming from a Scratch and Python standpoint, but I do understand where it is coming from. It is a perfect environment for using with touch based devices and works out of the box with Android and iOS web browsers.

Its interface is rather intuitive and for beginners, I think it will work great. You can run your code once you are ready on the virtual Microbit simulator to the right, or hit compile to download the .hex program file.

Microsoft Block Editor

Same script as above, in Microsoft Block Editor.
Same script as above, in Microsoft Block Editor.

Microsoft Block Editor (based on Google Blockly) is more Scratch-like environment for building programs. It is based on Blockly (same as App Inventor). Students and teachers familiar with MIT Scratch or App Inventor will feel at home using the block editor.

To use it, you grab blocks from the menu on the left hand side of the screen and drag them onto the programming space.

The Block Editor works fine on a touch device, but is best suited to computer with a keyboard and mouse. It again also has the same simulator as Touch Develop to the right.

Out of the 3 web based editors available right now it is my favourite.

Code Kingdoms Javascript Editor

Same program, this time in the Code Kingdoms Javascript editor. Using full block/icon mode.
Same program, this time in the Code Kingdoms Javascript editor. Using full block/icon mode.

Not having ever really used Javascript, I was not really sure what to expect when trying the Code Kingdoms Javascript Editor. I will admit, I was certainly through pleasantly surprised.

Like Microsoft Block Editor, your available code blocks are down the left hand side, but unlike the other 2 web editors, you can switch between blocks and icons, right down to the raw Javascript itself if you want. This can be done using the slider at the bottom of the page and allows the more proficient programmer kids to go on ahead and write the text based code, while the students just starting out can stick to the blocks/icons mode.

By using the slider at the bottom, you can switch over to the raw Javascript code view.
By using the slider at the bottom, you can switch over to the raw Javascript code view.

Overall, it is a very nice and intuitive editor and a bit of a mixture between the block based system used in Microsoft Block Editor and the more code based approach of Microsoft Touch Develop.

MicroPython (with Mu)

Mu editor with the same shake program, written in Python using MicroPython.
Mu editor with the same shake program, written in Python using MicroPython.

The final platform built for students to use with the Microbit is MicroPython and the Mu editor.
(It is worth pointing out here I am only looking at Mu, the offline editor for MicroPython. An online editor is coming but isn’t ready just yet)

Python is arguably now the most popular text based programming language used in schools with students. It is an extremely versatile language and has an easy to pick up, human readable focus on it.

MicroPython is an implementation of Python based off Python 3 for microcontrollers and devices with limited resources. This makes it a perfect candidate for use with the Microbit.

As part of bringing MicroPython to the Microbit, one of the developers decided to go ahead and build a beautiful offline environment to write your Python in. This editor is called Mu and can be grabbed from its Github repository. I am extremely impressed with Mu and MicroPython in general. It really opens up the possibilities of students doing some proper crazy stuff in a language they may have already had experience with. I am doing a separate post on Mu and MicroPython with more detail on the project as I have been most involved with it.

I think the biggest fundamental feature MicroPython on the Microbit has over the other platforms is it provides (if you install the driver on Windows, is included on Mac and Linux) a full console, or REPL. This allows you to simply type Python commands straight in and see the results. It also allows scripts to print data back to the serial console. It is worth pointing out though, Mu does not include any Microbit simulator like the other 3 platforms.

 

Edge connector

Microbit-Pinout2

The Microbit features a large golden edge connector at the bottom. This edge connect brings out a number of GPIO pins from the microprocessor. 5 of these pins are large pads, designed to be used with crocodile clips. These 5 pins include 3 GPIO pins, 3V and ground. The 3 GPIO pins include Makey Makey style resistive touch which is a nice addition.

Although it looks like plenty of pins to work with, be warned that many of them have additional functions, whether that be driving the LED matrix, buttons or the I2C interface. Unfortunately because of this, instead of 22 GPIO pins, you actually really only have 9 pins you can use without interfering with other parts.

Of the 9 GPIO pins brought out with no additional features, 3 (0, 1, 2) can be used as analog sensor inputs while all can be used with PWM.

Other interfaces available on the edge connector includes I2C (pin 19 and 20) and SPI (pin 13, 14, 15). It is also possible to redirect UART serial out to any 2 pins, but in doing that you loose the REPL over USB. Right now, only MicroPython supports working low level with these interfaces.

Kitronik edge connector breakout board.
Kitronik edge connector breakout board.

To make use of all but the 5 touch pads, you will need to get yourself a breakout board. Kitronik do an excellent (and pretty cheap) one over on their site which is available in assembled or unassembled form. They also have a rather nice assembled motor driver board available.
I am sure more companies with bring out similar boards when the Microbit is officially launched and publicly available.

Microbit vs Raspberry Pi

Microbit-Pi

This is a question I have had a lot when chatting to people about the Microbit, especially teachers.

“What is the difference between the Microbit and the Raspberry Pi?”

The simple answer is they are completely different kettles of fish!
Here is why:

  • The Raspberry Pi is a full computer that you can plug a keyboard, mouse and screen into. The Microbit is not, it needs another computer to program it. Interestingly you can use a Raspberry Pi to program a Microbit!
  • The Microbit has an acceleromenter and compress built in, along with 2 buttons and a 5×5 LED matrix. The Raspberry Pi does not include anything like that out of the box, you have to purchase an addon board (HAT) or other modules and plug them in.
  • The Raspberry Pi can be programmed in many many more programming languages and platforms, hundreds even given it runs Linux. The Microbit can only be programmed in 4 or 5 languages.
  • The Microbit is very low power, using less than a 5th of the power of the Raspberry Pi.
  • The Microbit has GPIO pins like the Raspberry Pi, but only has 9 usable free ones, vs the Raspberry Pis 26 free GPIO pins.
  • Both support expansion interfaces like SPI and I2C, but the Raspberry Pi has libraries for many addon boards already, where as the Microbit doesn’t just yet.
  • The Raspberry Pi is much more powerful, the processor is 50-60 times as powerful and has 64,000 times as much RAM(16kb vs 1024mb)!

So the main difference is the Raspberry Pi is a full blown Linux computer, where as the Microbit has a simple little microprocessor which runs a single program and that is it. They can’t really be properly compared, but can be used alongside each other. The Microbit is a great starting point after which, a Raspberry Pi makes perfect sense to progress to.

It is pretty cool though that you can use the Raspberry Pi to program the Microbit. Using MicroPython, you can even use it as an “external sensor” for the Raspberry Pi. You could for example use it as a game controller for your game on the Raspberry Pi! Will be very exciting to see what people do with the Raspberry Pi and Microbit combined!

So what have I been doing with it?

I have been spending a majority of my time with the Microbit using MicroPython and in turn, breaking MicroPython!
Because the MicroPython environment is open source and on Github, it is really easy to open new issues for ideas for features or to contribute to documentation.

I have been fiddling about with a few of the less mainstream features including the new Neopixel library and playing with Touch support. I have gone into more detail about this in my MicroPython blogpost.

A few of my projects have involved a crazy mish-mash of wiring.
A few of my projects have involved a crazy mish-mash of wiring.

To conclude

I think there is a lot of potential for the Microbit. Sure a decent chunk will end up in drawers, on shelves or even on Ebay. But, those that don’t, those that get picked up by students with teachers that understand how to use them… Those it could really make a big difference with.

Will it inspire and create the next generation of computer scientists?
I am going to reserve taking a side till I can get a set and use it with a class of kids, but I can say with complete certainty,  it will certainly inspire thousands of students across the UK to give Computer Science a go.
And who knows, maybe some of them will go on to create tomorrows “next big thing” because chances are, it will involve computers.

The second part of this series, focusing on MicroPython on Microbit can be found here.

Where can I get more information?

Destination space at W5

On Tuesday 15th December 2015, Tim Peake, the first British ESA astronaut, launched on a Soyuz rocket from Baikonur Cosmodrome.

To celebrate this, a number of Destination Space public events were being held across the UK with one at W5 in Belfast.
Myself and some of the Northern Ireland Raspberry Jam team went along and with us, brought 10 Raspberry Pis, some Sense HATs and a stack of Raspberry Pi DOTS Boards.

Rocket dots

Our most popular activity we were running on the day was as usual, the DOTS boards. For the launch, I hastily added a new Easter Egg to the RPi-dots-minecraft program, a rocket simulation!

To enable the secret mode, you simply don’t draw the wings on the plane, causing your drawing to look like a rocket!

Lots and lots of rockets filled in by schoolkids!
Lots and lots of rockets filled in by schoolkids!
Lots of schoolkids busy drawing their customised rockets!
Lots of schoolkids busy drawing their customised rockets!

The activity was extremely popular with over 200+ students giving it a go.

We even had a real ESA astronaut, Jean-Francois Clervoy try out the activity!
We even had a real ESA astronaut, Jean-Francois Clervoy try out the activity!

Sense HAT activity

We also brought along a set of Sense HATs and set them up with the excellent Raspberry Pi Foundation Sense HAT pixel art activity.

Although not as popular as the DOTS boards, Dean and Art were certainly kept busy helping stacks of kids create some awesome pixel art using Python!

Of course, there were a number of creepers created.
Of course, there were a number of creepers created.

Thanks

Big thanks to the wonderful team of Northern Ireland Raspberry Jam volunteers who were able to make it down for the day and for W5 for having us. We all had a great day!

NI Raspberry Jam team at Destination Space. From left to right. Vincent Lee, Andrew Mulholland (myself), Dean Welch, Artemiy Knipe, Sam Stuart.
NI Raspberry Jam team at Destination Space.
From left to right.
Vincent Lee, Andrew Mulholland (myself), Dean Welch, Artemiy Knipe, Sam Stuart.

 

Mozilla festival 2015 is coming!

What is Mozfest?

Mozfest is the annual Mozilla Festival, run at Ravensbourne College in London. This year the event is running on the weekend of 7th-8th November 2015.

Attended by over 1700+ people every year from over 50 countries, it is no small event. What makes it pretty cool though is it is a weekend run by the community for the community. It is all about the open web and technology and has sessions ranging from Journalism to Science to Learning! The sessions overview can be found here with the full list of over 300 individual sessions here.

Who doesn't want a high five from Foxy.
Who wouldn’t want a high five from Foxy?

But, this year there is one big difference… There is going to be a massive new YouthZone! Now when I say massive, I mean an entire floor of the college dedicated to stuff for young people (and people still young at heart) with over 30 different sessions.!

As part of this, the Raspberry Pi Community has come together with the Raspberry Pi Foundation to deliver a whole stack of awesome Raspberry Pi workshops, aimed at young people.

NIJam

In total, we will be running 17 workshops over the weekend, all aimed at complete beginners with titles including (to name a few)…

  • Astro Pi – Your Code in Space (by Carrie-Anne from the Raspberry Pi Foundation)
  • Musical fruit with the Explorer HAT (by Jim Darby)
  • Hacking Minecraft Pi with Python (by Yasmin Bey)
  • Scratch-ing the Surface with GPIO (by Cat Lamin)

All our workshops will be aimed at complete beginners, so even if you nothing about Raspberry Pi or programming, no matter!
On top of the above workshops in the main Raspberry Pi zone, we will also have 2 other satellite mini Raspberry Pi programming zones with one in the music zone with a key focus on making music with code (especially using Sonic Pi) and the other focusing on the Raspberry Pi Foundation Dots Boards.

Raspberry Pi Dots Board activity
Raspberry Pi Dots Board activity at a previous event

This all sounds awesome, I want to come!

Awesome! We would love to see you down at Mozfest. Tickets are only £3 for young people! For adults tickets are only £45… Tickets are full weekend passes and include lunch both days so is amazing value.

You can grab tickets here.

So all that is left to say is, see you at Mozfest!

BETT 2015 – Come say hi!

I will be traveling to BETT 2015 this year and will be there on Friday 23rd and Saturday 24th January.

Over the 2 days I will be giving 3 talks so if you are free, feel free to drop by and grill me with your questions!

Date – Time Talk title Where?
Friday – 11am Effectively managing Raspberry Pis using the free and open-source Raspi-LTSP Exa Networks – B228
Friday – 3pm The potential of MinecraftEDU in the classroom Exa Networks – B228
Saturday – 10:30am Effectively managing Raspberry Pis using the free and open-source Raspi-LTSP Raspberry Pi foundation stall

I will also be floating about the rest of the time, so if you want to say hi, drop me a tweet – @gbaman1.

andrew-jamboree

Should you learn to program before university?

This is response to Ryan Walmsley’s post recently where he concluded the answer to the above question to be no. Here is my response.

Scratch

Ryan brings up a number of interesting points on how he believes MIT Scratch should only be used with kids up to the age of 11. I highly disagree with this statement. Scratch is  an amazing platform for a beginner of any age! I have taught kids as young as 5 to even a 70 year old with Scratch. I really don’t think age has anything to do with it as a beginner is a beginner.

Like many universities, the Open University is faced with the issue that 90%+ of its students have never coded before. Although I don’t believe the module should be a full year, I guess it depends on the number of hours expected every week (is a full time course vs part time etc).

The Open university is far from alone in teaching using Scratch. Many universities in the United States use Scratch to teach their first year students. Code.org has produced a great video explaining why.

In the first few months, it is in my opinion more important to teach students the constructs and problem solving associated with computer science than teaching syntax. Syntax is different for every language, Scratch lets you move onto any language after where as jumping straight into a text based language may lock certain syntax into students heads as being associated with for example an if statement.

Although I will admit Scratch 1.4 is not a tad limiting for use with university students after more than a few weeks, Scratch 2.0 adds objects and a number of other items, making it much more suitable. Even better though would be Snap or byob.

Should we discourage students from learning programming before the course?

This though is the bit I personally disagree with most. Ryan concludes no, we shouldn’t be teaching kids to code.

Computer Science already has the highest dropout rates in UK universities (9.8%). Is this because it is just too hard for 9.8% of students? I don’t think so, I believe the high dropout rates are due to the students being misinformed about what Computer Science actually is. At school you already get a chance to study modern languages, art, business studies, history etc. All these subjects have direct follow on subjects at university and have much lower dropout rates. The students picking them have a rough idea what to expect given they may have been studying them for 7 years already at secondary school. With a majority of students, Computer Science is not an offered subject, how are they meant to have a clue what to expect if they don’t get a chance to try it out beforehand in school?

Many students do Computer Science as they believe it will follow on from A-level ICT, something which they then discover is very far from the truth.

Chicken and egg

It is a chicken and egg scenario though. If enough students study Computer Science in school, universities can add it to the requirements, but given it is statistically seen as a harder A-level, students won’t take it unless they are really interested in the subject until they need it for universities.

Some universities have taken the first step, I have to applaud my own University, Queens University Belfast who provide lower entry requirements for students studying A-level Computing. It is currently in the minority though in doing this, but more are starting to follow suit.

Pick a course that is right for you

It is ultimately up to the student though to pick the correct university for them. It is their job to read the fine details of their course and decide if the course content is right for them. If it isn’t especially in England, perhaps consider looking into a different university given there are quite a few with most having similar fees.

To conclude

To conclude, do I think students should be given the opportunity to code from KS2 onwards? Yes, it gives them a better ground to make a decision on a university course.

Do I believe MIT Scratch is worth using in universities? Yes, although would recommend Snap over Scratch due to more functionality.