Microbit touch example using block editor

The pins on your Micro:bit that are labelled 0, 1 and 2 can be used as touch inputs. To do this you need to touch the ground pin with one finger and one of the 3 pins with another.  A better method of testing is to use alligator leads and connect one end to an input and the other to a metallic object such as a coin.

We will be using the Block editor here – go to https://www.microbit.co.uk/create-code and select the Microsoft block editor

Here is an image of what you will be creating



Click on the compile button and this will generate a hex file on your computer, copy and paste this into your Microbit which if connected will show up as a drive on your computer.

Now touch the ground with one finger and the 3 pins and you should see the number displayed on the Micro:bit LEDs

LED pattern using the Microsoft Block Editor for Micro:Bit

Go to the micro:bit web site and follow the hyperlink to Create Code. Choose the Microsoft Block Editor and make a New Project.

Look in the Basic section for the show leds block.


Drag it into the code window and click on some of the check boxes to make a pattern. Here is our example pattern


Click the Run button in the browser and you can see a preview of the image on the right hand side of the page.


Simulations are fine but we want to see this on our Micro bit, Click on the Compile button to create a .hex file for the micro bit. You will be prompted to download the file, you can either download to your computer or straight to your Micro Bit.

The Micro Bit is similar to the MBed system in that it has an online compiler which creates hex files that you save to your computer or can save to your device as it appears as a drive on your computer, I save to my computer and drag it into my Micro Bit’s drive – just my preference

Once complete you should see the pattern on your Micro Bit