<< Back to activities

Binary's UFO (micro:bit) kit - Flashing the LED lights

This activity shows how to use Microsoft Make code - drag and drop blocks to make the UFO LED's flash.

Start >>

Step 1 - Wiring up Binary's UFO

 Firstly wire up Binary's UFO to the BBC micro:bit as shown below:

 

 

Next >>

Step 2 - Access the BBC micro:bit editor to be able to "code" on the micro:bit

When you are coding using the BBC micro:bit, you need to do it through their online Editor. 

Click on this link http://microbit.org/ to access the BBC micro:bit website. 

When it loads, click on "Let's Code" shown in the image below in the red box:

 

Next >>

Step 3 - Start a new project using the 'JavaScript Blocks Editor (PXT)'

There are lots of different types of editor you can use to program the BBC micro:bit. We are going to use the 'Makecode Editor' for this project. Click on the 'Let's Code' button to begin.

 

Next >>

Step 4 - Set up your project

If you have used the PXT editor before, it will remeber previous code, clicking on the 'New Project' button will allow you to make new code.

When the new project loads you will see two blocks on the page, an 'on start' and 'forever' block, delete these block by draging them over the tabs to the left

  →  

Next we need to change the name of the script, click in the 'Untitled' box located next to the download button at the bottom of the page. This will allow you to change the name to something meaningful i.e. Flashing LEDS

  → 

Next >>

Step 5 - Start to Code

First click on the ‘Input’ tab, select the ‘on button A pressed’ block and drag it onto the blank page

 → 

Click on the ‘advanced’ tab, then the ‘Pins’ tab. Select the ‘digital write pin’ block and drag it inbetween the ‘on button A pressed’ block

  → 

 

 

Next >>

Step 6 - Turning the LEDS off

Now we need to turn the led off. Click on the ‘Basic’ tab, select the ‘pause’ block and drag it below the ‘digital write pin’ block

 → 

Change the ‘100’ to ‘500’

Next, right click on the ‘digital write pin’ block, duplicate it and place it underneath the ‘pause’ block

 → 

Change the ‘1’ on the second ‘digital write’ block to ‘0’

 

 

Next >>

Step 7 - Ready to test!

You are ready to test your code!!, because we are turning a pin on and off, you can not use the virtual micro:bit on the left of the page. you will have to download the code and put it onto the micro:bit instead

Next >>

Step 8 - Download the code ready for Binary's UFO

It is now time to see it work on Binary's UFO

On the bottom left of the editor is a button that says 'Download' - shown below in a red box

 

 

Next >>

Step 9 - Find your downloaded code file

 

Click on the downloaded file at the bottom of the browser - select 'Show in Folder'

 

This will open the folder containing all your downloaded files - this will include a file called something like 'microbit-Flashing-LEDS.hex'

 

Right click on the file and choose to copy it (this is ready for the next step)

 

Next >>

Step 10 - Plug in the micro:bit

 Now you need to plug the micro:bit on Binary's UFO, into your computer - using the USB cable that came with the micro:bit.

 

When you plug it in, a window should pop up on screen that looks a bit like this:

 

 

Next >>

Step 11 - Paste the code file to the micro:bit

 

Right click on a blank space within the micro:bit folder and choose 'Paste' - it will display a window a bit like the below as it copies the file to the micro:bit.

 

Next >>