Lesson 11: Make Shapes with Robot

Lesson Description

Learn how to make the robot move in a square, and move in a circle in the PictoBlox App. Understand how to control the individual motors and adjust the speed for different directions and shapes.

Knowledge Box

In the Robot palette, you will find a block named go () at () % speed for () seconds. Using this block, you can make the entire robot move forward, backward, left, or right instead of using blocks for individual motors every single time.

Activity 1: Making a Square

Now, it’s time to have some fun with the robot! Let’s make Quarky draw a square.

Coding Steps

Follow the steps below:

  1. Open PictoBlox App, go to My Space, and click on the + button to create a new file.
  2. Connect Quarky to PictoBlox.
  3. You have to make Quarky turn 90° left. The trick is to adjust the time.
  4. You have to check for the following situations:
    1. Overshoot: Your time is more. Decrease its value.
    2. Undershoot: Your time is less. Increase its value.
  5. Go to the Robot palette and add a go () at () % speed for () second The forward direction of motion, 100% speed, and 1 second are set as the default values.
  6. Then, add another go () at () % speed for () second block and change the direction to left. Remember the 90° left exercise we did above? You must use the same turning time you got during that exercise. Until now, we’ve made Quarky move forward and turn left just once. To make a square, it must repeat these steps three more times.
  7. Add a repeat () block from the Control palette and write 4 in the space. This means that all the blocks inside the repeat () block will run 4 times.
  8. Add both the go () at () % speed for () second blocks inside the repeat ()
  9. Complete the script by adding a when flag clicked block at the top.
  10. Now, run the script by clicking the green flag!
  11. Save the file as Square Robot.

Activity 1: Output

Challenge

Make a triangle shape using the robot.

Activity 2: Moving in a Circle

Now, it’s time to have some fun with the robot! Let’s make Quarky draw a circle.

Till now we were only focusing on the direction of the motors to move the robot. But when we have to make the robot move in a circle, we have to consider the speed at which both the wheels are moving. For example, to make the robot move in a circle in the anti-clockwise direction, we have to maintain the following conditions:

  • Both the wheels are moving in the forward direction.
  • The left wheel speed should be less than the right wheel speed.

Coding Steps

Follow the steps below:

  1. Open PictoBlox App, go to My Space and click on the + button to create a new file.
  2. Connect Quarky to PictoBlox.
  3. To implement this concept, we have to control the individual motors.
  4. To control the radius of the circle, the motor speed needs to be changed. If the difference between the motor speed is high the radius will be smaller and if the difference is less, the radius will be larger.
  5. Try to make a clockwise rotating robot as well.

Activity 2: Output

Make sure you finish and submit the assignment, as well as take the quizbefore moving on to the next lesson.

Table of Contents