Reflect a Matrix on a micro:bit

A micro:bit’s 5×5 LED display makes an abstract numeric matrix visible. Students can predict a transformation in NumPy, then check the result on physical hardware.

Goal

Connect array positions and values to LED locations and brightness, then explain what a horizontal reflection changes—and what it preserves.

Activity

  1. Give students a 5×5 matrix whose values range from 0 to 9.
  2. Before running code, have them shade a paper 5×5 grid to predict the LED image.
  3. Display the matrix on a USB-connected micro:bit using an instructor-prepared bitio setup.
  4. Apply np.fliplr(matrix) and ask students to predict the reflected matrix and LED image.
  5. Run the transformation, compare the prediction with the board, and repeat the reflection once more.
  6. If time allows, change every nonzero value by the same amount and discuss brightness clipping at 9.

Deliverable

Submit the original matrix, the predicted reflected matrix, and a short explanation of:

  • which values changed;
  • which positions changed;
  • why two horizontal reflections restore the original image; and
  • what information can be lost when values are clipped to the display’s 0–9 range.

Discussion and safety

  • NumPy runs on the computer; the micro:bit acts as a USB-connected display through bitio.
  • Flashing bitio firmware replaces the program currently stored on the board. Save any existing project first.
  • Use a data-capable USB cable and an instructor-approved firmware file.
  • The bitio newarch branch supports newer micro:bit hardware but is described by its maintainer as experimental. Prepare and test the classroom image before class rather than asking beginners to troubleshoot firmware.

Source material

First spotted in PTIR: November 14, 2026, Daily Briefing.

A CSTA community post by Oleg Gornov connected NumPy array operations in desktop Python with the micro:bit’s physical LED matrix through David Whale’s bitio library. The idea generated this lab because the board gives beginning students immediate evidence for matrix position, brightness values, clipping, and reflection without turning the lesson into a hardware-programming unit.

Consult the original step-by-step guide · Review the bitio source and compatibility notes

Written on November 14, 2026