Table of Contents

display () with ()

Description

The block displays the specified character on the Quarky RGB LED.

The block has the following inputs:

  1. Character to be displayed on the LEDs.
  2. Color of the RGB LED when displaying.

Example

The example demonstrates how to implement a while loop running from 1 to 9 and show it on the Quarky display.

Script

Output

Read More
The example displays how we can display a custom pattern on the matrix by making a script to display a Traffic Light.

Script

Output

Read More

Introduction

Dance motion with humanoid refers to using a robot that has a human-like appearance to perform dance movements. These robots are pre-programmed with various dance sequences and can also be customized to create unique dance routines.

To make the robot move, we need to use code to control its motors and servos. The code can be created using a programming tools/language such Pictoblox, Python, or Arduino. The code tells the robot which movements to make, such as lifting its arms, bending its knees, or spinning around.

Different actions can be used to create different dance moves, and the dance can be accompanied by music or sound effects. The robot can also be programmed to display different colors or patterns on its body as it moves.

Humanoid robots is a fun and creative way to explore the intersection between technology and the arts.

Code

Logic

  1. Here, we use the pre-defined dance and sequence of humanoid in our code.
  2. To begin, we first initialize the humanoid extension and set up all the required pins by dragging and dropping the necessary blocks.
  3. We use a forever loop to continuously play the dance sequence along with different sounds and display matrices.
  4. To make the dance sequence more interesting, we use different actions with the ‘do() action()() times() speed’ block. It’s quite fascinating.
  5. You can even try out your own dance movements by using different actions and adding your own creativity.

Output

Read More
Learn about face-tracking, and how to code a face-tracking Quadruped robot using sensors and computer vision techniques.

Introduction

A face-tracking robot is a type of robot that uses sensors and algorithms to detect and track human faces in real-time. The robot’s sensors, such as cameras or infrared sensors, capture images or videos of the surrounding environment and use computer vision techniques to analyze the data and identify human faces.
Face-tracking robots have many potential applications, including in security systems, entertainment, and personal robotics. For example, a face-tracking robot could be used in a museum or amusement park to interact with visitors, or in a home as a companion robot that can recognize and follow the faces of family members.

One of the most fascinating activities is face tracking, in which the Quadruped can detect a face and move its head in the same direction as yours. How intriguing it sounds, so let’s get started with the coding for a face-tracking Quadruped robot.

Logic

  1. If the face is tracked at the center of the stage, the Quadruped should be straight.
  2. As the face moves to the left side, the Quadruped will also move to the left side.
  3. As the face moves to the right side, the Quadruped will also move to the right side.

Code Explain

  1. Drag and drop the when green flag clicked block from the Events palette.
  2. Then, add a turn () video on stage with () % transparency block from the Face Detection extension and select one from the drop-down. This will turn on the camera.
  3. Add the set pins FR Hip () FL Hip () FR Leg () FL Leg() BR Hip () BL Hip () BR Leg () BL Leg () block from the Humanoid extension.
  4. Click on the green flag and your camera should start. Make sure this part is working before moving further.
  5. Add the forever block below turn () video on stage with () % transparency from the Control palette.
  6. Inside the forever block, add an analyzed image from the () block. This block will analyze the face the camera detects. Select the camera from the dropdown.
  7. Create a variable called Angle that will track the angle of the face. Based on the angle, the robot will move to adjust its position.
  8. Here comes the logical part as in this, the position of the face on the stage matters a lot. Keeping that in mind, we will add the division () / () block from the Operator palette into the scripting area.
  9. Place get () of the face () at the first place of addition () + (), and 3 at the second place. From the dropdown select X position.
  10. If the angle value is greater than 90, the Humanoid will move left at a specific speed. If the angle is less than 90, the Humanoid will move right at a specific speed. If the angle is exactly 90, the Humanoid will return to its home position.
Block Explained

  1. Create a variable called Angle and assign it the value of the face’s position.
  2. At the center of the stage, we will get the X position value which is zero.
  3. As we move to the left side the X position value will give you the negative value and as we move to the right side the X position value will give you the positive value.
  4. The x position value is divided by 3 which gives precise positioning.
  5. To set the angle at 90 when the face is at the center of the stage we have added 90 to the X position value.
  6. As we move to the left side the angle value will get decreased as the X position value is going in negative.
  7. As we move to the right side the angle value will get increased as the X position value is going in positive.

Code

Output

Our next step is to check whether it is working right or not. Whenever your face will come in front of the camera, it should detect it and as you move to the right or left, the head of your  Quadruped robot should also move accordingly.

Read More
All articles loaded
No more articles to load