Matrix MINI mBlock

Intro - mBlock

mBlock is a graphical programming environment based on Scratch Open Source Code that makes it easy to program Arduino projects and create interactive.

Environment Set Up

  1. Import Matrix MINI Extension to mBlockClick ‘Manage Extension’ as shown below.

    Add Matrix MINI extension to mBlock by clicking the ‘Add Extensions’ button.

    Please locate the directory of Matrixmini.zip, and select file type as zip file:

    Click yes to install extension. Then now you can see Matrixmini Extension shown as below.
  2. Open Extensions in mBlockAfter you install the latest version of Matrixmini Extension, please select both Arduino and Matrixmini Extensions.

    Select ‘Robots’ in the script area.

    Now you can see Matrixmini functions show above.
  3. Change Scratch interface to Arduino Mode
    In order to program and upload MINI, you have to change the interface to Arduino Mode.

    The Arduino Source Codes will be shown on the right side of the screen.
  4. Connect Matrix MINI to your PC
    Connect MINI with a USB cable to your PC, and select Connect->Serial Port -> MINI (Arduino UNO) COM Port

    Select Boards -> Arduino UNO.

    Once you see the green light on the Matrix MINI blocks, you may start programming!
  5. Upload Codes to MINI
    After finishing your first code, upload your codes by clicking ‘Upload to Arduino’.

    The uploading messages will be shown on the gray area below the Arduino side.

Instructions

mBlock

Scripts: All the blocks are sorted.

-Control: Structure blocks.

-Operators: Operation blocks.

-Data & Blocks: Variables and function blocks.

-Robots: Matrix Mini and Arduino blocks.

Drag the blocks to the editing area and stack together. Click on “Upload to Arduino” to upload the Arduino code translated from the blocks.

Blocks

Start with Matrixmini Program block. You are not able to use specific block without it.


Set the speed of DC motor one at a time. You can select the one you want to control by clicking on the downward arrow beside”1”. You can set the speed by the same method or just entering the number between 255 and -255.


Set the position of servo one at a time. You can select the one you want to control by clicking on the arrow beside”1”. You can set the position by the same method or just entering the number between 0 and 180.


Set RGBLed one at a time. You can select the one you want to control by clicking on the arrow beside”1”. You can set the brightness of each color by the same method or just entering the number between 0 and 255. R for red, G for green, and B for blue.


The status of the button on the controller, which returns a Boolean value.


Read the digital pin signal. The return is 0 (LOW) and 1 (HIGH) of the Boolean value, so it can be used for numerical operations.


Read the ultrasonic sensor value. The sensing data calculation formula is already included, so the return value is the distance between the sensor and the sensed object in centimeters.

01 Blink

Make the LEDs on the Matrix Mini controller blinking.

Example programs

Repeat the contained blocks for times. Same as the for loop function in Arduino.
Delay for seconds. Same as the delay function in Arduino.

Think about it

How to blink alternatingly?

02 Mixing Color

Change the color of RGB Led by adjusting the value.

Example Programs

Repeat the contained blocks forever. Same as the loop structure in Arduino.

Think about it

Can you change the color into white?

03 Press Button

Make a switch with buttons on the Matrix Mini Controller

Example programs

Delay for a while until the condition is reached.

Think about it

If we change the condition from “pressed” to “released”, What will happen?

04 Motor Control 1

Let’s make the robot move!

Example programs

If the condition is reached, execute the contained blocks.

Think about it

How to make it start to run and stop by pressing the different button?

05 Motor Control 2

There are three kinds of way to turn.

Example programs

Think about it

What’s the difference between these three kinds of way?

06 Ultrasonic Sensor

Ultrasonic sensor make the robot know the distance from an object in front.

Ultrasonic sensor

Example Programs

If the condition is reached, execute the contained blocks. If not, execute the blocks contained in else section.

Think about it

Can you use the sensor to make the robot stop moving before it hit an obstacle?

07 Infrared Sensor 1

Infrared sensor should be regulated before using.

Infrared sensor

Example programs

Adjust the screws on the sensor to correct.

Think about it

What will happen if we don’t correct the sensor?

08 Infrared Sensor 2

Let’s make a line-following robot with the infrared sensors.

Example programs

Here is a simple explain.

Pin3=0 Pin3=1
Pin2=0 Go straight Turn right
Pin2=1 Turn left stop

Think about it

We use two sensors here. is it possible to use only one sensor?

adidas yeezy boost v3 shoe adidas yeezy boost v2 shoes adidas yeezy boost 350 v3 shoe adidas yeezy boost 350 v2 shoes adidas yeezy boost 350 v2 black red adidas yeezy boost 350 v2 black white adidas yeezy boost 350 v2 triple white adidas yeezy boost 350 v2 cream white adidas yeezy boost 350 v2 black adidas yeezy boost 350 v3 grey adidas yeezy boost 350 v3 yellow