MyBlocks
The EV3 programming environment has a useful feature called the MyBlock editor. It allows you to save a chunk of EV3 code as a single block, so that you can use that sequence of code multiple times in a program or in other programs without having to rewrite it. Creating a MyBlock in EV3-G is analogous to defining a function in a text-based programming language.
We will create four MyBlocks for the Falcon's program; each executes a different aspect of the car steering. We use MyBlocks because these are fairly complex sequences of code and they appear multiple times throughout the RC program. Most of the Falcon's programming will be contained within these four MyBlocks. Creating MyBlocks for these important functions saves time and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access