Micro:bit Math Project
![FMTGDHZKVDTH7M1.png](/proxy/?url=https://content.instructables.com/F79/HRTG/KVDTH7UO/F79HRTGKVDTH7UO.png&filename=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](/proxy/?url=https://content.instructables.com/FKA/WMV2/KV2I5Z61/FKAWMV2KV2I5Z61.png&filename=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](/proxy/?url=https://content.instructables.com/FH1/T46E/KV2I5X9W/FH1T46EKV2I5X9W.png&filename=microbit-screenshot (2).png)
The main breakdown of the code is as follows:
- Starting the program with the two numbers, symbol, state, guess and answer variables
- The program starts waiting for the user to activate the math question.
- 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
- 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.
- 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](/proxy/?url=https://content.instructables.com/FR4/8O7Z/KV83R172/FR48O7ZKV83R172.png&filename=microbit-screenshot (4).png)
![microbit-screenshot (3).png](/proxy/?url=https://content.instructables.com/F36/2B7L/KV83R170/F362B7LKV83R170.png&filename=microbit-screenshot (3).png)
![microbit-screenshot (5).png](/proxy/?url=https://content.instructables.com/FCS/7LA6/KV83R171/FCS7LA6KV83R171.png&filename=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](/proxy/?url=https://content.instructables.com/FC0/PV9P/KVDTH6Y1/FC0PV9PKVDTH6Y1.jpg&filename=micro:bit Math game)
Thanks for exploring this project I hope that you enjoyed it!