Example Code for micro:bit-Division Operation

Calculation Competition: Division 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

Division Operation
Division Operation Example Code Download: https://makecode.microbit.org/_544dyFTy9X2L

Result

Generate random A and B within 0~10. 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