Get Ready

I'd like to rename this something like "Setting Up Your micro:bit." I'd also like to consider breaking this into multiple pages: "Using the Display Block" and "Saving Your Project" seem like they could each stand alone, if not also "Adding Blocks," which I'd like to rename "Adding a Library" and cover some of the library standard there. --MF, 3/16/22

2-AP-16: Incorporate existing code, media, and libraries into original programs, and give attribution. Building on the work of others enables students to produce more interesting and powerful creations. Students should use portions of code, algorithms, and/or digital media in their own programs and websites. At this level, they may also import libraries and connect to web application program interfaces (APIs). For example, when creating a side-scrolling game, students may incorporate portions of code that create a realistic jump movement from another person's game, and they may also import Creative Commons-licensed images to use in the background. Students should give attribution to the original creators to acknowledge their contributions.

MARY TODO: go through U3 workshop notes and add any suggestions about trouble-shooting that we ran into in the PD. --MF, 3/16/22

In this activity, you'll set up your micro:bit and write your first program in MicroBlocks.

Collect Materials

  1. micro:bit hardware board Gather Materials
    • micro:bit
    • USB cable
    • Battery pack (optional)

Set Up Your micro:bit with MicroBlocks

For this unit, you'll use a program called MicroBlocks, a Snap!-like programming language designed to control tools like micro:bit.
MicroBlocks logo

  1. Open MicroBlocks in a Chrome browser.
    Why Chrome?

    Chrome supports connecting a micro:bit to your web browser.

  2. Connect your micro:bit to your computer with a USB cable.
    animation of two expressions on micro:bit animation of two expressions on micro:bit
  3. green circle around a USB cable Select the USB icon in the upper left corner (shown right), then select your board from the dialog box. dialog box to connect micro:bit
  4. A green circle should automatically appear behind the USB icon, showing that the micro:bit is connected. If not, ask your teacher for help.
    green circle around a USB cable
I suggest a page break here. --MF, 3/16/22

A software library is a collection of procedures (blocks) that can be used in programs.

Adding Blocks

Your micro:bit is now connected, but you'll need to add more blocks to program it. You'll do this by adding a couple of libraries to MicroBlocks.

  1. Click the + symbol next to Libraries.
    plus sign next to Libraries circled
  2. Select "Basic Sensors.ubl" and then click "Open."
    plus sign next to Libraries circled
  3. Do the same to load the "LED Display.ubl" library.
I suggest a page break here. --MF, 3/16/22

Using the Display Block

One block that's unique to micro:bit is the display block. It's designed to look like the grid of LEDs on the front side of the board. There are 25 LEDs that you can turn on and off individually.

display block
  1. Drag the display block into the Scripts area (the large open area on the right), and design your own pattern by clicking the LED rectangles to turn them on or off.
  2. Click on the block once and a your pattern should appear on your micro:bit! (If not, work with your classmates or teacher to fix the problem.)
    smiley face on a micro:bit next to computer code
I suggest a page break here. --MF, 3/16/22

Saving Your Project

We should include instructions for saving UBP files. Here's a suggestion... --MF, 1/28/22

Saving in MicroBlocks is different from saving in Snap!.

  1. Save Your Work Download your project:
    1. Click the MicroBlocks "File" menu (MicroBlocks File menu icon).
    2. Choose "Save."
    3. Selecting a location on your computer.

    A file will download to your computer that you can open using MicroBlocks later.

In this activity, you learned how to set up a coding environment for micro:bit and made a pattern on the micro:bit LED display.