Introduction

PictoBlox is a Scratch 3.0-based graphical programming software that is the ideal companion for the setting the first step into the world of programming. Its user-friendly interface and drag-and-drop functionality eliminate the need to memorize syntax and rules that is the case in traditional programming languages and often times scares children and makes them hesitant. As a result, they only require to focus on the problem at hand and develop skills such as logical reasoning and problem-solving – the must-have skills in today’s technology-driven world.

Installing PictoBlox

Choose the appropriate Operating System (Windows, macOS, Linux) and follow the steps:

Exploring The Surroundings

Pictoblox UI scratch

PictoBlox, like Scratch, has the following basic elements:

  1. Sprites
  2. Stage
  3. Blocks
  4. Script

Sprites

A sprite is an object, or a character, which performs different actions in the projects. It understands and obeys the instructions given to it. The bear you see in the image is a sprite. His name is Tobi. He will be your coding buddy in PictoBlox!

A sprite has costumes, which are one of the many appearances of the sprite. Some sprites have multiple costumes, and you’ll use blocks to perform actions.

Stage

The stage is the area where the sprite performs actions according to your program. The stage has its own scripts and sounds. You can decorate the stage using images; these images are called backdrops. You can choose a backdrop from PictoBlox’s inbuilt library, paint one yourself, upload an image from your computer or even click a picture.

Script

A script is a program or a code in PictoBlox/Scratch lingo. It is a set of ‘blocks’ that are arranged below one another in a specific order to perform a task or a series of tasks. You can write multiple scripts all of which can then run simultaneously. You can write the scripts only in the scripting area which is in the center of the screen.

Blocks

A block is like a jigsaw puzzle piece which is used to write programs by simply dragging and dropping them below one another in the scripting area. Using blocks to write codes eliminates the errors that might occur while writing codes in traditional programming languages.

Block Palette

The block palette is under the Code tab. It consists of different palettes such as Motion, Sound, and Control. Each palette has different blocks that perform functions specified by the palette name. E.g., the blocks in the Motion palette will control the motion of the sprite and the blocks in the Control palette will control the working of the script depending on specific conditions.

There are other varieties of block palettes which can be loaded from Add Extension button located at the left bottom.

Modes

PictoBlox has two modes:

  1. Stage Mode: In this mode, you can write scripts for the sprite and boards like evive to interact with sprites in real-time. If you disconnect the board with Pictoblox, you cannot interact anymore.
  2. Upload Mode: This mode allows you to write scripts and upload it to the board so that you can use even when it is not connected your computer, for example, you need to upload a script for making moving robots.

Activity: Controlling LED with Spacebar

In this activity, we want to control evive’s pin 13 LED such that it will turn ON an LED when the spacebar is pressed and turn it OFF when released. We’re going to write a script for the same.

Logic and Flow Chart

Here, we have to keep checking whether the spacebar is pressed or not. If it is pressed, the LED must turn ON; otherwise, it must remain OFF.

LED control logic

Script

Now, we’re going to write a script based on the logic. Make sure that the Stage mode is selected as we will be working in real-time. Follow the steps below:

  1. Whenever you want to run a code, you have to start with a Hat block. Drag and drop the block named when flag clicked from the Events palette in the scripting area.
  2. Go to the Control palette and drag and drop the C-shaped forever block below the when clicked block to continuously check whether the spacebar is pressed or not.
  3. There are two possibilities: if the spacebar is pressed, the LED must turn ON; else, it must remain OFF. To check this, there is a block in the Control palette called the if-else block. Drag and drop it inside the forever block.
  4. Go to the Sensing palette and drag and drop the key () pressed? block inside the diamond-shaped space of the if-else block. The space key is the default key. It will sense, the above-mentioned condition.
  5. To control evive using Pictoblox, first, connect evive to your PC using USB cable provided with the kit. Then click on Board menu and select evive.
    Pictoblox Board Selection
    Further, you have to load evive extension using Add Extension at the bottom left (if not loaded automatically).
    Load Extensions
  6. Click on Connect menu and select the Port to which evive is connected e.g. COMXX or ttyXX.
    Pictoblox Port Selection
    Once you select the Port, the connect-disconnect icon on its right will become connected.
  7. To work with evive in Stage Mode, you must upload the firmware to evive. For that, click on the Upload Firmware button as shown in the figure.
  8. The pin 13 LED is connected to digital pin 13 on evive. To turn it ON, this pin must be set to HIGH. For that, go to the evive palette and drag and drop the set digital pin () output as () block below the if arm of the if-else block. Set 13 as pin and HIGH as output.
  9. Similarly, drag and snap another set digital pin () output as () block below the else arm and set the output as LOW to turn the LED OFF. The final script is given below.
    Controlling LED with space key

Your script is complete! Click on the green flag to start it. The whole script will start glowing indicating that the code is running. To stop it, click on the red octagon next to the green flag.

evive Notes Icon
Note: When working with any board in Stage mode for the first time, you will have to upload the firmware using Upload Firmware button.

Conclusion

In this tutorial, you learned about Pictoblox, a graphical programming software. You wrote a simple script, using which you controlled evive’s pin 13 LED using your keyboard and evive. But wait, what is evive?

evive is a brain that takes input and gives an output according to the set of instruction given to it. Here, it takes input from the computer via Keyboard and switches the LED ON or OFF, just like your brain which processes commands given by your mother, e.g. to turn the light ON and as a result you turn it ON.

This Helped
This didn't help
Close Menu
×
×

Cart

STEMpedia Starter Package is now on Indiegogo!
Get 41% OFF with Super Early Bird discounts!
x