Glossary: mBlock

View all subject updates

This glossary is organized by block type and the blocks appear in the same order as in the mBlock environment. There is an image and description of the blocks used. Additionally, extra notes like what is in the drop-down menus of each block are included for your convenience. The drop-down menus in each block will be referred to by number, indicating its position within the block left to right.

Robots

These blocks either gather data from the robot as inputs or result in actions of the robot as outputs.

mBot Program
This block starts your script and needs to be at the top of your program.

Subject Update Glossary M Block Figure 1

Movement
This block tells the robot to move or turn in a certain direction and speed.

  • Drop-down 1: run forward, run backward, turn right, turn left
  • Drop-down 2: speeds of 255, 100, 50, 0, -50, -100, -255 (negatives indicate movement in opposite direction)
Subject Update Glossary M Block Figure 2

Motor
This block adjusts the individual motor speeds. M1 should be the left motor and M2 should be the right motor.

  • Drop-down 1: M1 and M2; referring to left and right motors
  • Drop-down 2: speeds of 255 100, 50, 0, -50, -100, -255 (negatives indicate movement in opposite direction)
Subject Update Glossary M Block Figure 3

LED
Adjusts the LED lights on mBot.

  • Drop-down 1: all, led left, led right
  • Drop-down 2, 3, 4: LED intensity of 0, 20, 60, 150, 255
Subject Update Glossary M Block Figure 4

Tone (Buzzer)
Plays a tone and can be used to make buzzer or horn sounds.

  • Drop-down 1: various sound frequencies from C2 to D8
  • Drop-down 2: length of note including half, quarter, eighth, whole, and double
Subject Update Glossary M Block Figure 5

Ultrasonic sensor
Measures the distance from the ultrasonic sensor to nearest obstacle.This block can be used as inputs into other blocks, and are especially helpful condition values.

  • Drop-down: Port 1, Port 2, Port 3, Port 4. According to the building instructions the ultrasonic sensor should be connected to Port 3.
Subject Update Glossary M Block Figure 6

Line follower
Represents the line follower robot component, which has a left and a right sensor. See Student Sheet 3a as part of the lesson resources for Ages 7-11 and Ages 11-14 for more information on the meaning of line follower output values. This block can be used as inputs into other blocks, and are especially helpful condition values.

  • Drop-down: Port 1, Port 2, Port 3, Port 4. According to the building instructions the ultrasonic sensor should be connected to Port 2.
Subject Update Glossary M Block Figure 7

Line follower
Indicates whether a sensor (leftSide or rightSide) of the line follower robot component is sensing black or white. This block can be used as inputs into other blocks, and are especially helpful condition values.

  • Drop-down 1: Port 1, Port 2, Port 3, Port 4. According to the building instructions the ultrasonic sensor should be connected to Port 2.
  • Drop-down 2: leftSide, rightSide
  • Drop-down 3: black, white
Subject Update Glossary M Block Figure 8

IR remote
This block is used to program the buttons on the IR remote. This block can be used as inputs into other blocks, and are especially helpful condition values.

  • Drop-down: all of the buttons on the mBot remote. Note the #s on the remote appear as R# and the gear on your room is ‘Setting’
Subject Update Glossary M Block Figure 9

Control

These blocks can be used as inputs into other blocks, and are especially helpful condition values.

Wait
Tells your robot to wait a certain number (#) of seconds before moving on to the next line of code.

  • # can be changed by typing, i.e. the number 1 shown in the image below
Subject Update Glossary M Block Figure 10

Repeat
Makes whatever is inside it repeat the indicated number (#) of times. Notice the little arrow indicating everything inside will be run from the top again. These are called loops.

  • # can be changed by typing, i.e. the number 10 shown in the image below
Subject Update Glossary M Block Figure 11

Forever
Makes whatever is inside it repeat continuously forever. Notice the little arrow indicating everything inside will be run from the top again. These are called loops.

Subject Update Glossary M Block Figure 12

If, then, else
Makes whatever is inside it happen IF the specific condition is met. These blocks allow you to write conditional statements. Whether the instructions inside the block will run depends on whether the condition in the first line is met. You can put other blocks into the hexagon in the first line to establish a condition to check for.

Subject Update Glossary M Block Figure 13

Operators

These blocks are used to do mathematics and construct conditions used in Boolean logic, such as ‘and’, ‘or’ and ‘not’.

Random number
This block chooses a random number. You can set the boundaries of the number range by typing in numbers.

Subject Update Glossary M Block Figure 14

Less than

Checks if the first value is greater than the second value. The values can be other blocks or numbers that you type.

Subject Update Glossary M Block Figure 15

Equals

This checks if two values are equal. The values can be other blocks or numbers that you type.

Subject Update Glossary M Block Figure 16

Greater than

Checks if the first value is greater than the second value. The values can be other blocks or numbers that you type.

Subject Update Glossary M Block Figure 17

And

Checks if both conditions are true.

Subject Update Glossary M Block Figure 18

Or

Checks if either condition or both conditions are true.

Subject Update Glossary M Block Figure 19

Not

Checks if a condition is NOT true.

Subject Update Glossary M Block Figure 20
activity age bookmark-fill icon bookmark boy-girl calendar chevron-down icon close icon compass cross icon download encounter-live facebook gallery icon instagram icon Instagram icon linkedin links icon location mail icon map next play previous professional-development right-arrow icon search share single image social-media speaker spinner icon students subject-update teacher-resources tick icon time twitter user video-lesson video youtube