How to Program Arduino Board with PictoBlox: A Beginner’s Guide

How to Program Arduino Board with PictoBlox: A Beginner's Guide How to Program Arduino Board with PictoBlox Scratch Based Programming Software Ep 01 0.jpg 54 ezgif.com webp to jpg converter

Hello everyone, welcome to an exciting journey into Arduino programming using PictoBlox! If you’re familiar with Arduino and its programming dynamics, you might be aware of how challenging it can be to control hardware via code. But worry no more! This is where we introduce the magic of Scratch-based programming to simplify the process.

Understanding the Basics

Scratch, developed by the MIT Media Lab, is a graphical programming language that lets you create programs by stacking blocks. No more typing every single command—just drag, drop, and connect! Today, we’ll use PictoBlox, a powerful tool based on Scratch 3.0, allowing us to control various prototyping boards like Arduino Uno, Mega, ESP32, and eVive with ease.

What is PictoBlox?

PictoBlox combines the fun elements of Scratch with the utility of Arduino boards, offering a user-friendly interface for creating games, animations, and more. With PictoBlox, you can tackle creative projects and hardware control without getting bogged down by syntax errors or complex code.

“PictoBlox lets you code using graphical elements known as blocks instead of typing each instruction.”

Diving into the User Interface

Key Components of the Interface

  • Menu Bar: The purple menu bar at the top of the application contains essential buttons for navigating through PictoBlox.
  • Stage: On the right, you’ll find the white space designated as the stage. This is where your sprite, an object or character, performs actions as per your code.
  • Block Palette: Located on the left, this is where you’ll find blocks for scripting under various palettes in the Code tab.

Understanding Sprites

Sprites are the central objects or characters in your project, performing different actions based on your scripts. In our example, you’ll notice a bee sprite on the stage ready to take action.

Scripting Area

This is where the magic happens! You’ll write scripts using blocks from the Block Palette. Each script serves as a program to control different functionalities, such as turning an LED on or off.

Connecting Arduino Uno to PictoBlox

How to Program Arduino Board with PictoBlox: A Beginner's Guide How to Program Arduino Board with PictoBlox Scratch Based Programming Software Ep 01 0.jpg 1021 ezgif.com webp to jpg converter

Before we dive into programming, let’s ensure our Arduino Uno is ready to communicate with PictoBlox.

Step-by-Step Connection Guide

  1. USB Connection: Start by connecting your Arduino Uno to your computer via a USB cable.
  2. Select the Board: Click on the Board button in the toolbar and choose “Arduino Uno” from the dropdown menu.
  3. Port Selection: Next, click the Connect button and select the appropriate port to establish a connection.

Adding Arduino Blocks

Once connected, you’ll see new palettes specifically for Arduino Uno boards, ready for you to explore and utilize.

Creating Your First Script: Blinking an LED

Let’s create a simple script to make an LED connected to pin 13 of the Arduino blink. This is a classic beginner project for understanding digital outputs.

Building the Script

  1. Set Digital PIN Output Block: Use the block from the Arduino Uno palette to control the LED. You’ll need two blocks to make the LED blink on and off.[Set digital pin (13) output (high)]
    • Duplicate the Block: Right-click to duplicate and set the output in the second block to low.
    [Set digital pin (13) output (low)]
  2. Control Blinking Speed: Incorporate the Wait block from the Control palette to regulate the blinking timing.
  3. Building the Sequence: Arrange these blocks in sequence to construct your script. It controls the LED to blink once, turning on and off with a one-second pause.

Making the Process Continuous

However, a single blink isn’t very exciting. To create a loop:

  • Use the Forever Block: Encapsulate your blocks within a Forever block from the Control palette. This allows for continuous running until manually stopped.

Starting the Script

Every script needs a start point:

  • Head Block: Use the “When Arduino Uno starts up” block to begin your script journey.

Uploading the Script to the Arduino

How to Program Arduino Board with PictoBlox: A Beginner's Guide How to Program Arduino Board with PictoBlox Scratch Based Programming Software Ep 01 0.jpg 192 ezgif.com webp to jpg converter 1

Switch your PictoBlox to upload mode by toggling the mode button. This transition opens an editor window, generating the equivalent C program for your script.

Uploading Steps

  1. Convert to Code: Inspect the editor window to view the auto-generated C code.
  2. Upload Code: Click the “Upload code” button to flash the Arduino. Once complete, your LED will begin its blinking cycle.

Challenge: Speed Up the Blink

Before we wrap up, here’s a small task for you: Try increasing the speed of the LED blinking.

Hint: Focus on the Wait blocks to adjust timing and increase the speed.

What’s Next?

In our next session, we’ll explore adding sensory elements to your projects. Imagine being able to detect motion or sound with your setup!

Do you have questions about this project? Feel free to ask.


This wraps up our first adventure with PictoBlox and Arduino. Until next time, happy coding!