Micro:bit MadeCode

Organizing Code with Functions

A function is a reusable block of code that performs a specific task. Instead of repeating the same instructions multiple times in your program, you can group them into a single function and call it whenever needed. This approach helps keep your code organized and easier to understand. You can think of a function as a custom instruction that you define once and use many times.