Example Code for micro:bit-Subtraction Operation

Calculation Competition: Subtraction operation.

Hardware Preparation

  • Math & Automatic expansion board for micro:bit, Quantity: 1
  • micro:bit, Quantity: 1

Software Preparation

Makecode graphical programming, Mind+ platform.
Makecode Library Address: https://github.com/DFRobot/pxt-Math-Automatic.
About how to install a software library?

Wiring Diagram

No specific wiring required.

Other Preparation Work

Install the Makecode library from https://github.com/DFRobot/pxt-Math-Automatic.
About how to install a software library?

Sample Code

Subtraction Operation
Subtraction Operation Example Code Download: https://makecode.microbit.org/_MECYEzF147DP

Result

Generate random A and B within 0~50. Then the micro:bit LED matrix displays A-B for once. Players have to input the correct answer in 10 seconds. If the input answer is right, micro:bit displays "√", if it is not or timeout, display "×".

Additional Information

No additional information.

Was this article helpful?

TOP