Programming Quarky with Block Coding in PictoBlox

Description
Learn how to program Quarky with PictoBlox. Connect and code Quarky to create amazing projects like the Beating Heart in both Stage Mode and Upload Mode. Unlock the full potential of Quarky and its different Quarky Robots.

Introduction

Quarky is programmable with PictoBlox. PictoBlox is coding education software using graphical block-based coding and Python programming.

With PictoBlox, you can program every aspect of Quarky and the different Quarky Robots.

If you haven’t installed PictoBlox, please follow the instructions:

Windows Installer (.exe)

STEP 1: Download the Pictoblox Installer (.exe) for Windows 7 and above (Release Notes).

STEP 2: Run the .exe file.

Some of the device gives the warning popup. You don’t have to worry, this software is harmless. Click on More info and then click on Run anyway.

STEP 3: Rest of the installation is straight forward, you can follow the popup and check on the option appropriate for your need.

 

Your software is now installed!

macOS Installer

STEP 1: Download the Pictoblox Installer (.dmg).

STEP 2: Run the .dmg file.

Mobile App Installer

STEP 1: Open Google Play Store on your Smartphone and and search for PictoBlox or visit the link here to head over to the Google Play Store. You can even scan the QR Code below from your Smartphone to head to the PictoBlox App.

STEP 2: Install the PictoBlox App.

Connecting Quarky with PictoBlox

Let’s begin by first connecting Quarky to PictoBlox. Select your preferred type of device i.e. either the desktop/laptop or your smartphone and follow the instructions.

Desktop

Follow the steps below for connecting Quarky to PictoBlox:

  1. First, connect Quarky to your laptop using a USB cable.
  2. Next, open PictoBlox on your desktop.
  3. After that, select Block as your coding environment.
  4. Then, click the Board button in the toolbar and select board as Quarky.
  5. Next, select the appropriate Serial port if the Quarky is connected via USB or the Bluetooth Port if you want to connect Quarky via Bluetooth and press Connect.
    COM Port
  6. Click on the Upload Firmware button. This will upload the latest firmware in Quarky.
    Note: If your device already has the latest firmware, then PictoBlox will show the message – Firmware is already updated. For learning more you can refer to this tutorial: https://ai.thestempedia.com/docs/quarky/quarky-toubleshooting/updating-quarky-firmaware-with-pictoblox/
  7. Once the firmware is uploaded, Quarky starts the Getting Started program. This runs only for the first time. Run through it.

And voila! Quarky is now connected to PictoBlox.

Mobile

Follow the steps below for connecting Quarky to PictoBlox:

  1. First, power ON Quarky.
  2. Open PictoBlox on your smartphone. Go to My Space and make a new project by clicking the ‘+(plus)’ button in the bottom-right corner.
    PictoBlox in Mobile Phone
  3. Then, tap the Board button in the top-right corner of the toolbar.
    PictoBlox BoardSelect board as Quarky.
  4. Next, tap the Connect button:
    PictoBlox ConnectSelect your device from the list.

And voila! Quarky is now connected to PictoBlox.

Programming Quarky in Stage Mode

Let’s first understand what Stage mode is.

The Stage mode is a mode of working in PictoBlox in which we can interact with the components like sensors, actuators, and Quarky in real time. If you disconnect the board with Pictoblox, you cannot interact with Quarky anymore. In this mode, you can make games and animation by interacting with Quarky.

You can select this mode from here:

Project – Beating Heart

Let’s make the project of creating an animation of Beating Heart on Quarky.

Beating-Heart (4)

Follow the steps below:

  1. Let’s begin by first connecting Quarky to PictoBlox.
  2. Drag and drop a when flag clicked block into the scripting area from the Events palette.
  3. Add a forever block from the Control palette below the when flag clicked block.
  4. Inside the forever block, add a display matrix as () block from the Display palette.
  5. Open the drop-down by clicking on the tiny white arrow as shown in the image.
  6. Draw a small heart in the middle of the matrix as shown.
  7. Add a wait () seconds block under the display matrix as () block and set the waiting time as 0.2 seconds.
  8. Now, add another display matrix as () block and draw a bigger heart in the matrix as shown in the image.
  9. Add another wait () seconds block under the display matrix as () block and set the waiting time as 0.2 seconds.
    DANCE3
    Note: If you’re wondering what the wait () seconds block is for, here’s the answer: the wait block will ensure that there is a pause before the second pattern appears on the matrix.

And there you go! Quarky’s heart beats only for you!

Run the script by clicking the green flag.

Explore:  Disconnect Quarky from PictoBlox and observe the result. The beating heart should stop, as PictoBlox was sending continuous instructions to Quarky that it was following. Once the connection is broken, the instructions will no longer be sent.

Programming Quarky in Upload Mode

Let’s begin by understanding what Upload mode is.

Upload mode is one of the two modes you can write your programs in Pictoblox. This mode allows you to write scripts and upload it to the board so that you can use even when it is not connected to your computer, for example, you need to upload a script for making moving robots.

Once uploaded, the board runs independently according to the script. 

Project – Beating Heart in Upload Mode

Follow the steps:

  1. Switch to Upload mode by toggling this button. You’ll observe some changes in the UI.
  2. For starters, the stage is replaced by the editor window.  The editor window shows the equivalent Python code of the script you create.
  3. The other difference that you’ll notice is in the block palette. Those palettes whose blocks are used to interact with the stage and sprite such as motion, sound, and looks disappear.
  4. Since the when flag clicked block is not compatible with Upload Mode, you will find it to be grey. We have to remove it.
  5. Especially to upload the code into Quarky, when Quarky starts up block inside the Quarky palette is available. Scripts that wear this block get converted into Python code when you are in Upload Mode.
  6. Make the script with when Quarky starts up block.
  7. You will find the Python code automatically added to the editor on the right.
  8. Click on the Upload Code button.
  9. Once uploaded, you will find the Quarky heart beating!
Note: When switching back to Stage Mode, Quarky will cease executing Upload Mode code and be ready for realtime communication.

Conclusion

In conclusion, PictoBlox makes it easy to program Quarky with its graphical blockbased coding and Python programming. Knowing how to connect and program Quarky with PictoBlox will help you unlock the full potential of Quarky and its different Quarky Robots. With PictoBlox, you can create amazing projects like the Beating Heart in both Stage Mode and Upload Mode.

Table of Contents