Display (Quarky)

Display-(Quarky)
Extension Description
Controls the 7 x 5 RGB LED display.

Introduction

The extension allows the user to control the RGB LED display of Quarky.

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.
    Power Quarky
  2. Next, open PictoBlox on your desktop.
  3. After that, select Block or Python Coding 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

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.

Stage Mode

Stage mode is one of the two modes you can write your programs in Pictoblox. In this mode, you can write scripts for the sprite and boards to interact with sprites in real-time. If you disconnect the board with Pictoblox, you cannot interact with the board anymore. In this mode, you can make games and animation interacting with Quarky.

You can toggle between the upload mode and stage mode using the button on the top right side of Pictoblox.

Note:  You have to upload the firmware into the device before interacting with it. Please refer this doc: https://ai.thestempedia.com/docs/updating-quarky-firmaware-with-pictoblox/

In Python Coding Environment, use the following object declaration to use Python functions in Stage Mode:

quarky = Quarky()

Upload Mode

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

In this case, Quarky will run offline according to the program and it can not interact with the stage.

In Python Coding Environment, use the following object declaration to use Python functions in Upload Mode:

from quarky import *
Read More

PictoBlox Blocks

The block displays the specified emotions on the Quarky RGB LED. These emotions are static and predefined in the code.
The block displays the specified pattern on the Quarky RGB LED. These patterns are predefined in the code.
The block displays the specified text on the Quarky RGB LED. 
The block displays the specified character on the Quarky RGB LED.
The block is used to create custom patterns on the RGB LED display of Quarky.
The block changes the color of the particular RGB LED of Quarky.
The block turns OFF the specified RGB LED of Quarky.
The block turns OFF all the RGB LEDs of Quarky.
The block changes the brightness level of the RGB LEDs of Quarky to the defined value.
The block returns the hex code of the Red, Green, and Blue values specified.
All articles loaded
No more articles to load

Block Coding Examples

All articles loaded
No more articles to load

Python Functions

The function sets the specified RGB LED of Quarky (specified with X and Y position of the LED) to the specified RGB color and brightness value.
Syntax: setled(x_position = 1, y_position = 1, color = [0, 0 , 0], brightness = 20)
The function turns off the specified RGB LED of Quarky (specified with the X and Y position of the LED).
Syntax: clearled(x_position = 1, y_position = 1)
The function turns off all the LEDs of the Quarky.
Syntax: cleardisplay()
The function sets the RGB LED matrix to the pattern specified in Pictoblox. The parameter passed is a 35 char string where each char corresponds to a color in the color palette.
Syntax: drawpattern(pattern = “aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa”)
The function sets the RGB LED display matrix to the emotion specified: “happy”, “angry”, “crying”, “super angry “, “surprise”, “basic”, “love”, “nerd”, “reject”, “wave”, “thinking”, “giggle”, and “disco”.
Syntax: showemotion(pattern = “happy”)
The function sets the RGB LED display matrix to display the animation specified: “happy”, “nerdy”, “thinking”, “angry”, “contempt”, “blink”, “fear”, “surprise”, “wink”, “wave”, and “crying”.
Syntax: showanimation(animation = “happy”)
The function sets the RGB LED display matrix to display the specified pattern: “rainbow”, “rainbow strip”, “cloud colors”, “party colors”, “forest colors”, and “lava colors”.
Syntax: showpattern(pattern = “rainbow”)
The function sets the brightness of the RGB LED display matrix.
Syntax: setbrightness(brightness = 20)
The function sets the RGB LED display matrix to display the specified character.
Syntax: showtext(character = “A”, color = [0, 0 , 0])
The function runs the specified text message on the RGB LED of Quarky. You can also set the speed and the color of the text.
Syntax: showscrollingtext(message = “Hi I am Quarky”, speed = 1, color = [0, 0 , 0])
All articles loaded
No more articles to load

Python Coding Examples

All articles loaded
No more articles to load
Table of Contents