Programming With Mblock
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 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'
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:
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.
Objectives
Development
Objectives
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.