Smart Blocks work for EV3, SPIKE™, Zappy, and Ruby!
Smart Blocks are a great way to improve your coding skills and speed up your progress. They are basically a way to create functions.
Check out this video tutorial on YouTube.
To create a Smart Block simply follow these instructions:
- Click the 'Add Smart Block' button in the Blockly tool bar.
- Click '+ New Smart Block'. A pop up will open.
- Name your Smart Block and click 'Create'.
Note: your Smart Block's name should be short and meaningful, and can include letters and numbers, but cannot include empty spaces or unique symbols. Here are some examples:
Do Don't Turn90Right turn 90 degrees to the right Drive10sec newblock! DriveSquare smart block #2 - A new Blockly tab will open with a 'define' block.
- Add your code within the define block.
When done, simply click the 'Main' tab to go back to your main code editor. - Open the Smart Blocks category.
Your newly created Smart Block will be available there as a 'Call [SmartBlockName]' block.
When your code is executed, the Call block will cause the code in your Smart Block to run
Here is how to create a Smart Block that will make your robot turn 90 degrees to the right:
Tips and Tricks - and a word of caution!
You can duplicate, remove, edit, clear, and delete a Smart Block from your user by clicking the options icon when inside your Smart Block tab:
Keep in mind that doing any of these in one mission or project will result in the action being performed throughout your user. Tread with caution!
Comments
Please sign in to leave a comment.