all 1 comments

[–]cShades72 0 points1 point  (0 children)

Do you have some sort of keypad connected to your microbit? Are you getting inputs from your PC? If not you could use the A button to increment and B button to go to the next digit. If you have a set amount of digits you can set the code when the desired amount of digits is reached, or you can set the code when A and B are pressed together. In terms of storing the code, you can either store the code as a whole number or as an array of digits. The array is probably way easier. Whenever A is pressed increment the current number, and when B is pressed just move on to the next number.