How to Program Arduino Board with PictoBlox (Scratch Based Programming Software) | Ep: 01

How to Program Arduino Board with PictoBlox (Scratch Based Programming Software) | Ep: 01


Hey everyone! Welcome to “Arduino with PictoBlox”. In this video, we’re going to program an
“Arduino Uno” board using “PictoBlox”. Most of you must be familiar with “Arduino”
and with its “Programming”. And you know how tedious it can be to control some hardware using a program. This is where “Scratch” comes into the picture. It is a graphical programming language developed
by MIT Media Labs. It lets you code using graphical elements known as “blocks” instead of typing each instruction. This makes programming fun, interactive, and
eliminates the need to worry about syntax. PictoBlox, the programming software that we are going to use today is based on Scratch 3.0. You can make games, animations, and do loads of other cool stuff with it- like controlling prototyping boards such as Arduino Uno, Mega, ESP32, and evive. (which is almost impossible to do with Scratch, and that’s why we chose PictoBlox) Let’s have a quick look at the user interface. There’s a purple-colored “menu bar” at the top with several buttons. The white space on the right is called the “Stage”, the area where the “Sprite” performs
actions according to your “code”. A “Sprite” is nothing but an object or a character which performs different “actions” in your projects. The bear (our beloved TOBI) standing in the stage is a sprite. On the left is the “block palette”. It consists of different palettes under the “Code” tab. Each “palette” consists of “blocks” which are used for writing “scripts” in the “scripting area”. “Scripts” are the programs that we write. In this video, we’re going to write a script for controlling the LED connected to Arduino Uno’s “digital pin 13”. For controlling Uno, we need to connect it to PictoBlox. First, connect it to your computer via a USB cable. Then, click on the “Board” button in the toolbar and select its name from the “drop-down menu”. Next, click on the “Connect” button and select the appropriate “port”. In doing so, you’ll notice new palettes below the “My Blocks palette”. You can control Uno using the blocks from the “Arduino Uno palette”. To control the LED connected to pin 13, we’re going to use the “set digital pin () output block”. We need two such blocks to make the LED blink. So, “duplicate” it by right-clicking on it and set the output in this block to “LOW”. Now, to control the “speed of blinking”, we’re going to use the “wait block”. Go to the “Control palette” and drag and drop one (wait block) below each “set digital pin () output” block. Now let’s stack all the “blocks” together. Observe that this script will only run “once”; in other words, the LED will turn ON, wait for a second and then turn OFF. To make the process “continuous”, we’ll use the “forever block” from the “Control palette”. It will run the script continuously till the time you stop the script. To start any script, a “hat block” is necessary. So, drag and drop “When Arduino Uno starts up” block above the script. Now, we need to upload it to the board. For that, switch to “Upload mode” by toggling this button. The “Stage” is replaced by an “editor window” with the equivalent C++ program for the script. To upload the code, click on the “Upload Code” button. Once the upload is complete, the LED will start blinking! Before we call it a day, here’s a small task for you: try “increasing the blinking speed of the LED”. The hint lies in the wait block. That’s all for now! In the next video, we’ll find out how to give senses to our projects. If you have any questions regarding this video, let us know in the comment section below. And if you liked the video, don’t forget to give it a thumbs up (and SUBSCRIBE for more educational videos like this)! I’ll see you in the next video. Good bye for now!

4 thoughts on “How to Program Arduino Board with PictoBlox (Scratch Based Programming Software) | Ep: 01”

Leave a Reply

Your email address will not be published. Required fields are marked *