3. mBot Code Blocks
3.1. Show
The Show
code blocks control the LED panel
if you have it installed. Typically, the LED panel is installed on port 1
.
Block |
Effect |
---|---|
displays image with duration |
|
displays the specified image |
|
displays image at coordinate |
|
displays the specified string |
|
displays string at coordinate |
|
displays the specified number |
|
displays the time |
|
clears the screen |
3.2. Light and Sound
Block |
Effect |
---|---|
shows |
|
shows |
|
shows color with |
|
plays |
|
plays a sound at |
3.3. Action
Block |
Effect |
---|---|
move |
|
move |
|
turn |
|
turn |
|
move |
|
turn the |
|
stop moving |
3.4. Sensing
Block |
Effect |
---|---|
toggles |
|
toggles |
|
toggles |
|
line sensor detects color |
|
onboard button is pressed |
|
button pressed on |
|
sends and |
|
the |
|
toggles |
|
resets the timer |
3.5. Events
Block |
Effect |
---|---|
when the |
|
when a |
|
when the robot starts up |
|
when the |
|
when a message is received |
|
broadcast a message |
|
broadcast a message and wait |