Workshop Wednesday – micro:bit

Standard

micro:bit is a pocket-sized computer from the BBC that you can code, customise and control to bring all sots of cool creations to life from robots to musical instruments. It measures 4cm by 5cm and has 25 red LEDs to display messages, two programmable buttons for uses such as controlling games or skipping songs in playlist, it can detect motion and tell which direction it’s pointing and can use Bluetooth to communicate with other devices and the Internet.

microbit-diagram

To get started with micro:bit and to find out more about it visit microbit.org

microbit-1

To get started with coding with micro:bit, once on the website you can select the “Let’s Code” section

microbit-2

You can then select the “Let’s Code” button in JavaScript Blocks Editor (PXT) section

microbit-3

Once the editor has loaded you can switch to the “JavaScript” tab and then enter the following code:

basic.forever(() => {
    basic.showString("Hello World!")
})

Which should then appear as follows:

microbit-4

You can also select the “Blocks” tab, which is an easy to use drag-and-drop style of programming for younger or less experienced coders.

microbit-5

This example will run automatically in the “virtual” micro:bit displayed on the page and will scroll through the text “Hello World!”.  To run the example on a real micro:bit select the “Download” option

microbit-6

Once the file is downloaded connect the micro:bit to your computer it will show up in “Explorer” / “My Computer” on Windows for example as another drive with the name microbit and you can copy the “.hex” file to it, an LED on the back of the micro:bit will flash while it is copying and once done the example should run the same way as the one on the website but this time on the real thing!

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s