Group Assignment — Inputs & Outputs

SENSORS
&
OUTPUTS

Jaswant Singh & Amrinder Singh

We explored the Micro:bit by testing different inputs — sensors and board controls — alongside different outputs, including LEDs and external lights. All four challenges were coded using the Microsoft MakeCode interface.

Read Challenges
01 Joystick 02 SoftPot 03 NeoPixels 04 Buttons
▶ Video
● Challenge 01 Joystick Pixel Control
01
Sensors

A joystick module gives two analog inputs (X and Y). The Micro:bit reads the values through pins connected to the module.

02
Outputs

The 5×5 LED display. A single pixel moves around the screen depending on joystick direction.

03
What We Learned — Inputs & Outputs

Analog inputs can control movement in two directions, and threshold values affect how responsive the control feels.

04
What We Learned — Programming Interface

We used Microsoft MakeCode to read analog values and update X/Y coordinate variables for the LED grid.

05
How the Project Works

The program reads joystick X and Y values in a loop. If a value crosses a threshold the pixel moves. Boundary checks keep it inside the 5×5 grid.

01
Sensors

A SoftPot (linear potentiometer) sends analog values to the Micro:bit that change depending on where you press along its surface.

02
Outputs

The 5×5 LED display. The pixel position shifts left or right based on the SoftPot reading.

03
What We Learned — Inputs & Outputs

Analog values can represent position along a surface, and mapping those values lets us control the LED grid precisely.

04
What We Learned — Programming Interface

We used MakeCode to read the analog pin and map the result into a 0–4 range for the LED screen columns.

05
How the Project Works

The program reads the SoftPot value, maps it to a column (0 to 4), clears the display, and plots the pixel at the new position.

▶ Video
● Challenge 02 SoftPot LED Control
▶ Video
● Challenge 03 NeoPixel Tilt Control
01
Sensors

The Micro:bit's built-in accelerometer measures tilt on the X, Y, and Z axes and acts as the input.

02
Outputs

NeoPixel LEDs. Colour and brightness change in real time based on how the board is tilted.

03
What We Learned — Inputs & Outputs

Built-in sensors can act just like external inputs, and continuous sensor values can smoothly control LED brightness.

04
What We Learned — Programming Interface

We used MakeCode blocks and JavaScript to read acceleration values and pass them directly to the NeoPixel extension.

05
How the Project Works

The program continuously reads tilt values, maps them to a colour and brightness range, and updates the NeoPixels on every loop.

01
Sensors

The Micro:bit's onboard buttons A and B act as the inputs, each triggering a different animation mode.

02
Outputs

NeoPixel LEDs display different colour patterns depending on which button was pressed.

03
What We Learned — Inputs & Outputs

Button presses can switch between multiple output states, and designing custom animations shows how versatile the LED output can be.

04
What We Learned — Programming Interface

We used MakeCode button event blocks and a variable to track and switch the current animation mode.

05
How the Project Works

Pressing a button updates the mode variable and starts the matching LED animation. Animations loop until another button press changes the mode.

▶ Video
● Challenge 04 Button LED Animations