Class Meeting 06: Advanced Blockly - Battle of the ClicBots

Learning Goals

Lecture Overview

Here is a link to the presentation slides for today.

Programming Exercise #1: Getting the first joint pair to work together.

In this first exercise, get some hands on experience with measuring joint angles and using that measurement to move other joints. To begin, build a ClicBot that has 6 joints with the base, a long arm, a gripper, and a brain, as pictured below.

ex 1 plain build

Then, create a new program that measures the angle of joint A (pictured). HINT: use the "detect servo angle" sensor in the sensors tab.

Once you're familiar with how the angle reading of joint A changes as you rotate the joint upon its axis, add additional logic to make joint B mimic the movements of joint A.

HINT 1: you can use constant offsets to account for the angle difference in which joint A and joint B start at.

HINT 2: is your logic correct but the program not doing anything? Maybe it is doing something really but just doing once, really quickly that you didn't notice. How do you get it to keep doing it?

exercise 1 build with joints labeled

This is what your finished product should do.

final gif
Discuss as a group: Once you're done, compare your program with your neighbors - are there any drastic differences? If so, what do you think contributed to this disparity?

Programming Exercise #2: Please pair up with your neighbor and build a big robot

IMPORTANT: In order to ensure that everyone in the group has a chance to participate, please refer to the Group Assignment Sheet to see who is responsible for which task. Please check with an instructor when you're done with each task.

Please build the following robot as pictured below. Note: you will need to borrow your neighbor's joints to make this work.

This robot will require 9 joints, 1 long arm, 1 gripper, 1 brain, and 1 smart foot. Once you're settled in with your combined group, raise your hand and we will hand you a smart foot.

ex 1 plain build
ex 1 plain build

Programming Exercise #3: Program 3 of the Big Robot's joints

Please refer to the following diagrams for the correct joint pairing. Note that there are 2 vertically rotating joints and 1 horizontally rotating joint. The exercise is broken down into 3 parts, 3.1, 3.2, and 3.3. The individual assigned to each task must complete that task, discussion with the team is encouraged.


  1. Blue joint pair
  2. Green joint pair.
  3. Red joint pair.
ex 1 plain build

Here's a demo of what your end product should be able to do. Note: Your implementation doesn't have to be exactly the same, as long as it does something similar, you're good.

ex 1 plain build
Discuss as a group: This exercise will likely challenge your debugging skills. It's important to note that there are usually multiple ways to solve a problem - I would encourage y'all to try whatever comes to mind!

Programming Exercise #4: Program the Gripper & Smart Foot

You're nearly done! The last thing you'll need to program as a group is the gripper and the smart foot. Your program logic should aim to open/close the gripper based on pressure input on the smart foot. Note: the units of force used by the smart foot is Newton

Here's a demo of what your end product should be able to do. Note: Your implementation doesn't have to be exactly the same, as long as it does similar things, you're good.

ex 1 plain build

Programming Exercise #5: Optimizing Your Program and Powering Up Your Robot Build

Now that you're done with building and coding the Big Robot, take turns trying to pick up blocks and drop them into the Accessories box.

This is also a good opportunity to fine tune your program so that it behaves exactly like you want it to. You're also encouraged to modify the structural design of your robot by adding additional joints, grippers, etc. This will give you an edge in the competition you'll have against your neighbors in the next exercise. Winners will get prizes! Feel free to check out the rules in Exercise 6.

ex 1 plain build

Programming Exercise #6: Battle of the ClicBots

Challenge your neighbors to a battle! Please ask your instructors who your team should battle against.

The objective of this game would be to score the most points by picking up blocks and placing them into your team's box. The different blocks are worth different number of points!

If you manage to decapitate your opponent's robot, your team will win by knockout!

ex 1 plain build

Optional Programming Exercise #7: Using a Joint as a Sensor

If you're done with the other exercises, please work on this exercise from last week: The goal of this exercise is to create a ClicBot robot that is controlled by the rotation of one of it's joints. If you rotate the joint quickly, the robot will move fast. If you rotate the joint slowly, the robot will move slowly. Let's get started.

First, build a ClicBot that looks like the following picture:

Robot Exercise 4

As mentioned before, you'll rotate one of the ClicBot's joints to guide it's forward speed. We've attached the ClicBot holder to make this joint easier to rotate. See below for an example of how to rotate this joint for this exercise.

Rotating Joint

Now that we have the robot set up, let's get more specific about it's behavior. You'll design three "modes" for the robot:

The following piece of code gives you a snippet of what you'll need for this program.

joint as sensor starter code

You'll want to use the if block to detect how fast your joint is moving. You'll use the sensor block Detect rotation speed of Joint [NO.X] to get the rotation speed of the joint. You'll need to compare it to a numeric value. Then, you'll need to specify the wheel rotations that will follow that joint rotation speed using the Wheel [NO.X + Direction] rotation, speed block.

Some tips for this exercise:

Requirements to Meet Expectations for Today's Class