Micro:bit Math Project

by afmcdnl in Teachers > 5

1596 Views, 0 Favorites, 0 Comments

Micro:bit Math Project

FMTGDHZKVDTH7M1.png

This project uses four micro:bits to set up a math equation for the user to calculate and then enter into the primary micro:bit to check.

Supplies

The project is very simple on the requirements:

  • Four micro:bits
  • Optional micro:bit mounting location

Project Plan

micro_bit math project.png

With the plan in mind - there is one primary micro:bit and three secondary micro:bits. The primary micro:bit does all of the control, sending of the numbers and math. The three secondary micro:bits are only for the display of two numbers and the math symbol.

Detailed Code Main Code

microbit-screenshot (2).png

The main breakdown of the code is as follows:

  1. Starting the program with the two numbers, symbol, state, guess and answer variables
  2. The program starts waiting for the user to activate the math question.
  3. By pressing A and B together it will go into the next part - randomly picking of the numbers and math symbol and then sending those values to the secondary micro:bits
  4. The secondary micro:bits display the values and symbol and wait until the user pick the correct answer, using A and B to raise and lower their guess.
  5. Use A and B together to 'lock in' their answer.


Code is included in the next step but users are invite to try it out themselves.

Detailed Secondary Code

microbit-screenshot (4).png
microbit-screenshot (3).png
microbit-screenshot (5).png

Uploaded Code

The code for the four micro:bits are included here for your pleasure.

The main code and the three secondary micro:bits.

Video Explanation

micro:bit Math game

Thanks for exploring this project I hope that you enjoyed it!