Blocks Area
Functions
🔧 Functions – Your “Time-Saving Superblocks”.
What it is: Blocks that group several instructions into one.
What it does: Create your own code blocks.
Example: Create a function called “blinkLED” that turns the LED on and off.
👉 They are like shortcuts or “superblocks” that save time.

🧩 Fun Guide to Functions Blocks (Clu-blocks Pro)
🧠 Important! Function blocks let you create your own mini-programs that you can reuse anytime. Think of them like custom spells or super tools — you build them once, and then call them whenever you need them!
| # | Block | What it does | Dropdown options | What the options mean |
|---|---|---|---|---|
| 1 | procedure (with gear icon) | Creates a custom function | — | You name it, add inputs, and build what it does — like designing your own robot move |
| 2 | procedure with return | Creates a function that gives back a result | — | You can use this to calculate something and return the answer (like math or sensor checks) |
| 3 | return | Sends a value back from a function | — | Must be placed inside a function — it’s like saying “here’s the result!” |
| 4 | if ... return | Returns a value only if a condition is true | — | Great for smart decisions — like “if button is pressed, return ‘go’” |
| 5 | procedure with: x | Defines a function with an input called x | — | You can pass values into your function — like giving it a number or a name to work with |
| 6 | inputs with: x | Sets up the input for your function | — | You decide what kind of info your function needs — like a speed or direction |
| 7 | with: y | Another input block for functions | — | You can add multiple inputs — like x and y for coordinates or options |
| 8 | allow statements (checkbox) | Lets you add actions inside the function | — | If checked, you can put loops, conditions, and other blocks inside your function |
🧠 Quick Tips for Students
- Use functions to organize your code — no need to repeat the same blocks over and over!
- Use inputs to make your functions flexible — like changing speed or color.
- Use return when you want your function to give back a result — like a score or sensor value.
- Always build your function first, then call it when you need it — like pressing a button to activate a move.