Factorial Calculator
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
This is the code for the factorial calculator, which uses a 2-button system to change the number you want to factorialize:
The Instructions
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
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.