Now we know how to create a simple My Block, lets create a My Block with an output variable that we can use within the main program. How to Create a My Block with an Output Variable From here, the My Block should be available from the light blue My Block palette.I’ll use the Sound icon for this example.Enter a description and select an Icon from the My Block Icons.Note: the name cannot contain spaces, so it’s best to capitalize the first letter of each word if the name has more than one word – this makes it easier to read.Note: Make sure the Start Block is not selected, otherwise a error message will appear stating that the Start block cannot be included in a My Block.Select all 5 blocks and from the Tools menu select My Block Builder.Select the file Lego Sound Files | Communication| Go.Drag and drop a green Sound block next to the last block (one).Repeat this for the numbers four through to 1.Select the file Lego Sound Files | Numbers | Five.Drag and drop a green Sound block next to the start block.The following example combines a 6 sound blocks that can be used for a countdown (5, 4, 3, 2, 1, Go!): How to Create a Simple My BlockĬreating a My Block is as simple as selecting the blocks you wish to use within the My Block and selecting My Block Builder from the tools menu. It’s also very useful when you have a bunch of common functions that can be simplified and reused within a single block in the programming software. bringing multiple blocks into a single block). My Blocks are especially handy when you have a largely complicated program and you need to simplify the user interface to make it more readable (i.e. My Block Builder can be used within the software to create a My Block. It consists of one or more programming blocks and combines them into a single block which is available from the light blue My Blocks palette. What is a My Block?Ī My Block is a way to build your own blocks within the Lego MINDSTORMS EV3 programming software. They control motor rotations and also image, sound and the light on the EV3 P-brick. The action blocks control the actions of the program. Lego Mindstorms EV3 Software is based on verity types of blocks that can be connected to control the behavior of your robot. For more detail on this, see our installation post here. Lego Mindstorms Ev3 Programming Softwareīefore you start, please make sure you have the LEGO MINDSTORMS software installed and connected to your EV3 brick.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |