Factorial Calculator
![20210804_124119.jpg](/proxy/?url=https://content.instructables.com/FON/DSPL/KRXI1RFG/FONDSPLKRXI1RFG.jpg&filename=20210804_124119.jpg)
This is a calculator anybody could use to calculate the factorial of any non-negative number
Supplies
A micro:bit
A phone or computer
Anything that you can use to upload code to a micro:bit
A phone or computer
Anything that you can use to upload code to a micro:bit
The Code for the Micro:bit
![download (1).png](/proxy/?url=https://content.instructables.com/FSO/3AMC/KRWGG0LI/FSO3AMCKRWGG0LI.png&filename=download (1).png)
This is the code for the factorial calculator, which uses a 2-button system to change the number you want to factorialize:
The Instructions
![download (2).png](/proxy/?url=https://content.instructables.com/FUH/FURM/KRXI1RH9/FUHFURMKRXI1RH9.png&filename=download (2).png)
Instructions: If you press button A, you increase the number you want to factorialize by 1. If you press button B, the opposite happens. If you press button A and B together, you factorialize the number. If you press the reset button on the back of the micro:bit, you reset the program back to the start.
Setting Up
![download.png](/proxy/?url=https://content.instructables.com/FZH/RK80/KRWGG0KQ/FZHRK80KRWGG0KQ.png&filename=download.png)
To set up your micro:bit, you can go ahead and plug it into a computer so that you can flash your program from the online editor to your micro:bit or plug the micro:bit into a wall, use Bluetooth on your phone to connect to it and use the micro:bit app to send programs.