Write Micro:bit Functions to Make Code Clean

Clean code means “bug free” and “easy to use”. Try to wrap up good code fragments in to functions and re-use them.