User Tools

Site Tools


What is MicroBit?

The micro:bit is an educational and creative tool to inspire a new generation of young people. It can be used across the curriculum, not just in STEM subjects. It can help give young people the knowledge and skills to move from being consumers of digital information, to being designers and creators of new tools to enhance learning, to solve problems or just to have fun, enabling them to make the most of 21st Century life and the economy. To learn more click here.

Let's make the virtual dice used on the Scratch-Cliff Erosion model a real one

In this section, you will learn how to make a virtual dice a real one (i.e. one that you can touch). But this dice will not only throw a number but will also send the resulting number to another micro:bit via Bluetooth. That is not all, the receiving micro:bit is connected to a PC with a java version of the scratch cliff erosion model. At the end of this exercise you will have learnt not only how to code a dice on Microbit, but also how to stream the resulting number, fetch it and use it as an input of your cliff model.

You will need the following materials to do this exercise:

  • A male to micro USB cable to connect your computer to your BBC micro:bit. This is the same cable that is commonly used to connect a smart phone to a computer
  • Two micro:bit units. One with a battery pack
  • A foam dice in which we could insert the micro:bit with the battery pack
  • A laptop or PC running Windows 7 or later with the following software installed:
    • Java. To run the Cliff Erosion model jar file.
    • You must install a device driver (for the computer to recognize the serial interface of the micro:bit). Learn how to do it here

The coding for creating a virtual dice with wireless streaming is very simple and can be downloaded from here microbit-rotating-dice.hex

Note you have to download the same .hex code to two microbits… one acts as a remote sensor, the second must be connected to your computer with a USB lead and acts as the radio receiver.

Download and unzip the CliffErosionApp.jar and its resource folders

Open a MS-DOS command window and go to the folder you have just created that contains a file named CliifErosionApp.jar.

Connect one of the micro:bit unit to your computer with the USB cable and identify which COM port has been assigned to the micro:bit. You can find out the COM Port number using the Device Manager and looking at the Ports (COM & LPT). Annotate the number of the COM port that appears labelled as “mbed Serial Port (COM?)”, where ? will be an integer number.

Turn on the micro:bit unit with the battery pack and hide it within the foam dice. If you want that the dice number coincide with the number through out by the micro:bit you have to orientate the microbit in the same way than shown in the picture below.

Type the following command to execute the jar file: java -java CliffErosionApp.jar

The program will then ask you to enter the COM port number at which the micro:bit unit is connected. If your COM port is, for example, number 5 you should type “COM5” and click enter to the program to start.

Throw the dice and see what happen with the house at the top of the cliff!

microbit.txt · Last modified: 2018/03/16 11:03 by coastalmeadmin