Search Header Logo
MyBlocks

MyBlocks

Assessment

Presentation

•

Business

•

9th Grade

•

Practice Problem

•

Medium

Created by

Jennifer Bertke

Used 2+ times

FREE Resource

20 Slides • 10 Questions

1

media
media

modified from work by Sanjay and Arvind Seshan

INTRODUCTION TO MY BLOCKS

2

media

A My Block is a combination of one or more blocks that you create that can be grouped into a single block

it's custom and can be used in multiple programs

accepts input and renders output

​

What is a My Block?

3

Multiple Choice

Select the FALSE statement about My Blocks.

1
My Blocks can only be used once in a project.
2

My Blocks can be programmed to combine multiple other commands.

3

My Blocks can be shared with other users and used in other programs.

4
My Blocks can be customized with user-defined inputs.

4

media

Why Should You Bother?

Because of My Blocks, your missions will look like this…

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

4

Instead of this….

This makes your code easier to read and easier to modify!!!

media
media

5

media

calibration to your build will be required, but you could easily adjust your turns based on map changes without having to guess and check

​

Examining My Blocks vs Standard

media

6

Labeling

Which blocks represent My Blocks?

Drag labels to their correct position on the image

these are typical action blocks

these ones

7

What Makes a Useful My Block

Making My Blocks with inputs and outputs can make them more useful. However, you need to be careful not to make the My Block too complicated.

Question: Look at the list of three My Blocks below. Which ones do you think are useful for to use?

◦ Move5CM (Moves the robot five centimeters)
◦ MoveCM with a centimeter and power input
◦ MoveCM with centimeter, power, angle, coast/brake, etc. inputs

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

5

8

What Makes a Useful My Block

Question: Look at the list of three My Blocks below. Which ones do you think are useful for to use?

Answer:

◦ Move5CM may be used often, but you will be forced to make other My Blocks for other distances. This will not be fixable later.

◦ MoveCM with centimeters and power as inputs is probably the best choice.
◦ MoveCM with centimeters, power, angle, coast/brake, etc. might be most customizable, but some of the inputs might never be used.

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

5

9

Multiple Choice

Which is probably the most useful of the My Blocks listed below?

1

power on and power off

2

Move5in : moves the robot 5 inches

3

MovePowerIn : moves the robot a selected number of inches and power level

4

MovePowerInAngle Coast/Brake : moves the robot a selected number of inches, power level, and sets coast or brake

10

media

Step 1: Highlight Blocks

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

6

For this lesson, our goal is to move a desired amount of rotations at a desired power and return the ultrasonic value at the end

• Step 1: Select the two blocks in the code that you want to turn into a My Block

11

Multiple Choice

Question image

Based on the lesson goal and the blocks shown, what would be the inputs and outputs for the My Block?

1

Inputs: power, rotations

Outputs: distance measured by the ultrasonic sensor

2

Inputs: power

Outputs: rotations, and distance measured by the ultrasonic sensor

3

Inputs: Power, measurement of the ultrasonic sensor

Outputs: rotations

4

Inputs: Power, measurement of the ultrasonic sensor, rotations

Outputs: none

12

Step 2: Launch My Block builder

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

7

• A: Go to Tools 🡪 My Block

Builder - If you encounter an error, view the next slide

• B: Pick a My Block Name

• C. Add a Description

• D. Select an Icon for the
whole My Block

Move Rotations and output
Ultrasonic

A

B

C

D

media
media

13

Reorder

Reorder the following steps after you have launched the My Block builder:

Go to Tools 🡪 My Block Builder

Pick a My Block Name

Add a Description

Select an Icon for the whole My Block

1
2
3
4

14

Common Error Messages

◦ SOLUTION: You need to highlight all the blocks again before going into My Block Builder

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

8

​ERROR 1: You must be on a diagram with a selection to create a My Block:

media

15

Common Error Messages

ERROR 2: Start Blocks are not allowed in the selection when creating My Blocks. Remove any Start Blocks from your selection and try making your My Block again.

◦ SOLUTION: Un-highlight the start block before going into My Block Builder

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

8

media

​X

16

Common Error Messages

  • If you continue to have trouble at this step, just select a single block in your program and create a My Block from it.

  • You can edit add more blocks to a My Block at any time.

  • However, you cannot change the inputs and outputs of a My Block after creation.

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

8

17

Multiple Choice

True or False: You should always include a start block in your selections for My Block conversions.

1

TRUE

2

FALSE

18

Step 3: Add Inputs/Outputs

A. We need to add two inputs and one output so we will click the +
button three times

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

9

media

19

Step 3: Add Inputs/Outputs

B. Go back to the first parameter

C. Go to Parameter Setup

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

9

media

20

Open Ended

What is the difference between an input and an output for your Lego Ev3?

21

media

Step 4: Setup Parameter for Power

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

10

B. Select Input

A. Pick a Name

D. Choose a default value

Move Rotations and output
Ultrasonic

Set min & max values (only available with slider)

C. Power is a Number

E. Choose button Style

A

B
C
D

E

22

Reorder

Reorder the first broad steps to making My Blocks:

highlight blocks

launch My Block builder

add Inputs/ Outputs

Setup Parameter for power

1
2
3
4

23

media

Step 5: Setup Parameter for Rotation

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

11

Move Rotations and output
Ultrasonic

Now click on the
second parameter

A

B
C
D

E

B. Select Input

A. Pick a Name

D. Choose a default value

C. Rotation is a Number

E. Choose button Style

24

media

Step 6: Setup Parameter for
Ultrasonic

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

12

Move Rotations and output
Ultrasonic

A

B
C

Now click on the
third parameter

B. Select Output

A. Pick a Name

C. Ultrasonic output is a Number

25

Step 7: Setup Parameter Icons

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

13

In this step, we will change the icons for the parameters from “a” to an image of your choice.

A. Click on a parameter

B. Click on the tab Parameter Icons if not already on this tab, and choose an icon

C. Repeat steps A and B for each parameter

D. Press Finish when you are done.

media
media

26

Reorder

Reorder the first broad steps to making My Blocks:

highlight blocks

launch My Block builder

add Inputs/ Outputs

Setup Parameter for Power, Rotation, and Ultrasonic

1
2
3
4

27

media

Step 8: Add Data Wires

A. When you click Finish (on previous slide) you will see this.

B. Wire up the My Block by dragging a data wire from each parameter to its corresponding slot on the move steering block and sensor block.

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

14

media

​These grey blocks are our inputs/outputs (parameters) that were set up automatically by the My Block Builder

28

Multiple Choice

What is the purpose of a data wire?

1

To cook food, play music, or control temperature

2

To transmit data between parts of the programs

3

to record values experienced by the sensors in the RAM

4

To make the program easier to read

29

Where is the My Block?

A. Your My Block will appear in the turquoise tab. You can now use this block in any program.

B. Below, the same My Block is used twice. Once to move forward 2 rotations and then backwards 5 rotations.

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

15

media
media

30

media

Credits

This tutorial was created by Sanjay Seshan and Arvind Seshan

© 2015 EV3LESSONS.COM (LAST EDIT 7/06/2016)

16

This work is licensed under a Creative Commons

Attribution-NonCommercial-ShareAlike 4.0 International License.

pattern-tertiary
media
media

modified from work by Sanjay and Arvind Seshan

INTRODUCTION TO MY BLOCKS

Show answer

Auto Play

Slide 1 / 30

SLIDE