More Micro:bit Part 1



I had a brief post about the Micro:bit back in early September but I wanted to go into some more detail about the board and what you can do with it.  Sparkfun.com is still a great source for the Micro:bit and all of the accessories I'll talk about today - and they also have some great video tutorials for learning about the bit and the extra kits.  Here's the site:  https://www.sparkfun.com/microbit

The Micro:bit Go Bundle is a great start, it costs only $16.50 and you get the bit, USB cable, and battery pack with batteries.  Prices on Amazon are a bit higher so I'd recommend buying from Sparkfun.

Once you have the bit you can start programming at the Micro:bit site, www.microbit.org  Actually, you can start programming without the bit, since the site provides a very good interactive simulation of the board.  Once you're at the site, choose the Let's Code option from the menu bar.  If you are new to programming you can then choose the JavaScript Blocks Editor.  You can then start coding - Let's Code or look at the Lessons and/or References.  These sections provide descriptions of the commands you'll be using as well as programming examples.

The first screen looks like this:


If you're familiar with Scratch programming you'll recognize the component groups and blocks.  One great feature - notice that you can switch from the Blocks environment to JavaScript just by clicking on the option on the menu bar (more about this later.)  If you aren't familiar with Scratch, you can go to www.scratch.mit.edu for some tutorials and examples.  It's a free, online programming environment requiring only e-mail and a password for sign in.  There are also some very good Scratch tutorials on Youtube and lots of great books to get you started.  I'll be doing a post on Scratch shortly.  

Back to the the Micro:bit site - a good way to start is by looking at some of the example projects.  Click on Projects on the menu bar, then Examples.  Choose the Name Tag program.  It should look like this:

In this program you have two blocks, both from the Basic set (the medium blue color option from the column in the middle of your screen.)  A Forever block - meaning do whatever is inside forever, and the show string block which contains the text that will be scrolled across the microbit LED matrix, forever.  You should see James being scrolled across the simulated Micro:bit to the left of your screen.  If you type in a new name in the text field, then that new name/text will be scrolled across the matrix.  

This is all happening on your virtual Micro:bit.  If you want to download it to your own Micro:bit, then click Download.  This puts the program in the Download file on your computer.  If you have your Micro:bit plugged in (via the USB cable) it will show up in your file directory, just like a USB drive or HD card, and you can drag the file from Downloads to Micro:bit.  This loads it on the bit and you should see the text you entered in the block, scrolling across the bit.  

Try some more of the examples, making changes to the program to see what happens.  

NOTE:  If you'd like to see what the program looks like in a non-graphical programming language you can click the JavaScript tab on the Menu bar.  I've included two pictures below, both show the same program,an example called Egg and Spoon Race.  The first shows Blocks, the second JavaScript.



In the next post I'll talk about the accessories for your Micro:bit, including an Arcade game and a Robot.




Comments