0% found this document useful (0 votes)
17 views9 pages

Programming With Mblock

This document describes how to use mBlock, a block-based visual programming environment for programming robots and boards like Arduino. It explains the categories of blocks, how to upload programs to boards, and features of the programming environment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views9 pages

Programming With Mblock

This document describes how to use mBlock, a block-based visual programming environment for programming robots and boards like Arduino. It explains the categories of blocks, how to upload programs to boards, and features of the programming environment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Programming with mBlock

In the 21st century, robotics has begun to transform human life, not only in the
it is not only present in the industry but also in everyday tasks,
making human life easier and making the tasks that were previously more efficient
were carried out without the help of robots. Robotics refers to the area that encompasses the construction of
autonomous devices that act in the real world in such a way that they perform a task
specific. This means that robots can know the environment that surrounds them
using sensors of different types and, based on the information acquired, they can
modify its trajectory or simply move and thus avoid obstacles. And, of course,
we have to program a robot. MBlock is a friendly and easy-to-use software and learn-
since it is designed for young girls and boys. The programming is visual and for
blocks, very similar to the Scratch application; in particular, because it allows programming

various schemes such as, for example, a video game. For its part, mBlock incorporates the
possibility of programming robots and various boards, such as Arduino and micro:bit. The variety of
available blocks on this platform allow programming a wide range of possibilities
behaviors. The mBlock application has some features that make it more
suitable for working with robots. If we upload the program to the board, how do we do it?
with the IDE (integrated development environment) of Arduino (in the next chapters we will go deeper)
about this topic), allows us to make autonomous robots without having to always
permanently connected to the computer (we only have to load the program,
and then it is executed autonomously). Additionally, when loading the programs of this
You can see the code equivalent of the program we have designed with the
blocks, in such a way that it can help us during the transition from graphical environment to code.
Another advantage is that mBlock allows us to define which pins we want to use as
inputs and which as outputs.

The first screen we access in mBlock presents the following interface:


On the left side, there is the stage of everything that we are programming and designing.
they will start putting into practice the orders and actions that we indicate. In the center are the
categories of programming blocks, that is, the pieces with which the pro-
game grammar of the video game or the robot, with a large number of commands and options that
We can start selecting to then fit into the right sector, which is in the space.
where the program is built and where the selected pieces are placed.

The official site of mBlock, where we can also download the program to install on
our computer is: https://www.mblock.cc/en-us/ To program the boards and the
various existing robots, we will focus on some more specific blocks that,
it is worth noting, they are similar to those of the Scratch application. In general, to program a
robots use the following categories of blocks: Robots, Events, Control,
Operators, Data, and Blocks. Another topic to consider is that the Panda Bear is the avatar.
predefined for what we want to create with mBlock, that is, the character that the students
they will control. Keep in mind that the Panda Bear or avatar is only available when it
program, for example, a video game; but when programming a robot, it is not possible
preview the behavior of the robot in the Panda Bear. It is also important to highlight
we can replace the Panda Bear with another character or icon that we consider.
Development of some mBlock blocks to work with robotics Block
Movement

With these blocks we can make the Panda Bear move forward or backward.
the distance that we want, that rotates on itself, that changes direction (here
we can work with the theme of angles), move it to the desired coordinates (it is
very important to work on this topic from Primary School), etc.

Block 'Control'

With these orange blocks, we can perform programming logic, like the
loops, make decisions, achieve that an action is repeated several times, that waits
determined time to execute the following action or, also, to indicate that the
the program performs an action if certain conditions are met, and if not met, it...
create another one (command YES). With programming logic we define the rules and the
parameters that our project will have or tasks that we want the robot to perform such as,
for example, if we want it to stop or turn when our robot detects an obstacle in
his way. Also, issues related to the different sensors that can be
to use.
Block 'Sensors'
With them, it is possible to detect if the Panda Bear performs the following actions: touches an object,
touch a determined color or how far it is from another object or from a robot.
It also allows detecting when a certain color touches another color, the input of
variables through the keyboard or if a key on the keyboard is being pressed. From
the verification of all these possible actions can make the Panda Bear jump, stop,
step back, it adds points if we are in the presence of a game, change the screen,
etc.
Block 'Robots'

The "Robots" block, in dark blue, is an exclusive group of tools created by


Makeblock. It works for both its own mCore boards and the Orion base board, as well as for the
Arduino boards, which are the 'brain' of Makeblock robots. This group of blocks does not
it exists in the standard Scratch program. For the specific case of the Makeblock robot,
called mBot, the "Robots" block expands and updates this group as it introduces
new sensors in their robots.

Among the block commands is the one that sends the message "Run the program".
"loaded onto the robot" when it turns on. Replaces the block of the green flag of the
Scratch application when a program is run. Thanks to this block, once it is passed
the program, the robot can work without being connected to the computer via USB cable or
Bluetooth. To upload a program to the Arduino board, the mBot must be previously
connected to the computer via a USB cable, then click with the button
right over the block "mBot Program" and select Upload to Arduino.
Programming environment

The mBlock programming environment is free and works with various types of systems.
operational and can be downloaded from http://www.mblock.cc/download/. Once installed, we see
the following window:
MBlock consists of 5 main parts:

1. "Instruction group" classified by colors in the following categories:


• Movement: a set of instructions related to control of the
pins of the Arduino board, as well as the control of the movement of
any character on stage.
• Appearance: instructions aimed at modifying the appearance of the
characters of our application. In the case of Arduino, it is a set of
instructions that are rarely used.
• Sound: a set of instructions related to the preparation of
musical applications that emit sounds and musical notes.
• Pencil: Scratch offers us the possibility for the characters to leave a trail.
during their movements on stage as if a pencil were being dragged
during its trajectory.
• Control: the instructions included in this section are essential for
create the logic of our programs. They include conditionals, loops and
procedure calls.
• Sensors: instructions for iteration with the mouse, the keyboard, sounds and
the characters.
• Operators: mathematical operations, logical operations, and with text strings.
• Variables: instructions for the storage and management of data.

2. "Programming Instructions": The instructions for each group correspond to


programming instructions.
3. "Editor": it is the main space where we structure and program our
program.
• Programs: it is composed of all the instructions that make the
code that we program.
• Costumes: each object can have different appearances or costumes for
use throughout our program.
• Sound: it is also possible to add or record sounds and save them for future use.
uses.

4. "Main stage or window": It is the result of our program.


5. "Objects and sprites": We mainly distinguish between Arduino-type objects and
sprites.
• Arduino type objects are those that interact with Arduino.
• Sprites are similar to the Scratch environment and do not interact with Arduino.

Tutorial to use Arduino with mBlockhttp://www.instructables.com/id/How-to-use-


mBlock software to control Arduino UNO
Programming with mBlock E

It is important to highlight that mBlock is based on Scratch 2.0, so programming is


similar to Scratch and only a group of additional blocks are added to manage the
Arduino ports or the boards of the robots.

Next, a tutorial: http://www.atlantistele-


They will also be able to
access programming in Arduino with mBlock: https://www.scolartic.com/
We program our board
Arduino_graphically_with_mBlock_1481817824297/ e1e495e5-14ff-4338-8752-
92840e203fa5?version=1.0

Educational proposal 1: Historical game

The proposal is that, throughout the school year, students work on solving
programming challenges in which they will have to reinvent classic digital or analog games
gicos and adapt them: Arkanoid, Metegol, Counter strike. During the first stage of the year,
they will carry out an exploration and initial practices with the games. In the second part of the year,
the students will start working on a script for their reinventions. It is expected that
that script that is built collaboratively, for which the
Google Drive tool. On the other hand, students should research about some
event or historical fact to then create and design the characters in shape
analog and, later, digitize them. For example, in the Art class, they could
draw and then scan your design or obtain them from a photograph. Finally,
They must program the erasers of the designed game in mBlock.

Educational proposal 2: Designing a version of the game Hangman

Objectives

• Strengthen correct writing.


• Distinguish and classify words according to their accentuation.
• Create a video game taking into account programming and design.
• Work collaboratively to develop the proposal.

Development

The language practice teacher will ask the students to be organized in


groups of four people, think and generate a list of words with a high degree of
difficulty, separating them into grave, acute, esdrújula, and sobreesdrújula. Once completed
the list approved by the teacher, the students must think of a format of
program that simulates the traditional game Hangman, but using the list of
words previously constructed.

Educational proposal 3: Redesigning the video game Carmen San Diego

Objectives

• Reinforce knowledge in the area of Social Sciences.


• Develop a script collectively that includes the development of the
history.
• Recreate the video game Carmen San Diego based on the programming with
mBlock.
• Fostering the development of creativity in the area of Visual Arts to achieve the
character design.

Development

First, the teacher should show them how the game Carmen San Diego was played, searching
some simulator or video on the web. During a class, they will play it to understand the work
they will have to carry out afterwards. After these introductory activities, the
students will form work teams and, in an organized manner, will begin to
write the script of the game. Each group will decide who will create the characters, the
scenarios and the programming. Once the script is created, the teacher will review the data
geographical so that there are no inconsistencies. Next, the students will design
The people will be helped by the art teacher and then will be digitized.
Some, through a scanner, and others, photographed. To finish the work process, the
Different teams should program the previously designed script in mBlock.

Alternative resources for programming • Hour of Code: https://code.org/hourofcode/


overview • App Inventor: http://appinventor.mit.edu/explore/ • Tynker:
https://www.tynker.com • Pilas Engine: http://pilasengine.com.ar/ • Mumuki:
https://mumuki.io/primaria • Alice: https://www.alice.org/

You might also like