Skip to main content
Teacher Portal

VEX V5 Clawbot with its arm up and claw open.
VEX V5 Clawbot with its Arm Up and Claw Open.

The Groove Machine Challenge

In this challenge, you will break up into teams and program your robot to go through a dance routine using your knowledge of loops. Your teacher will set a time limit for developing/testing the dance and a time limit for the length of the dance. Everyone not on the competing head-to-head dance-off teams will judge the dances and vote on the team that they think is best.

Rules:

  • Each Clawbot will dance one-at-a-time within the 1x1 meter area.
  • The dancing continues until the Stop button on the Brain's screen is pressed to stop the project from running.
  • The arm must be raised and lowered.
  • The claw must open and close.
  • The Clawbot must turn left and right.
  • The Clawbot must drive forward and in reverse.
  • The project needs to be stopped immediately if the Clawbot collides with anything or falls over. That is a losing dance.

Teacher Toolbox icon Teacher Toolbox

Judging for this competition could be handled in a number of ways. One way to increase engagement is to have students video record the dance-off and have students from other classes vote on the winner. If that is too ambitious, consider appointing a panel of impartial judges before beginning this challenge, or bringing in other students, teachers, or staff.

The solution below is merely a combination of all three example dance moves strung together.

# Library imports
from vex import *

# Begin project code
while True:
    arm_motor.spin_for(FORWARD, 300, DEGREES)
    arm_motor.set_stopping(BRAKE)
    
    for repeat_count in range(3):
        drivetrain.turn_for(RIGHT, 90, DEGREES)
        
        for repeat_claw in range(2):
            claw_motor.spin_for(REVERSE, 90, DEGREES)
            claw_motor.spin_for(FORWARD, 90, DEGREES)
            wait(5, MSEC)
            
        drivetrain.turn_for(LEFT, 90, DEGREES)
        for repeat_claw in range(2):
            claw_motor.spin_for(REVERSE, 90, DEGREES)
            claw_motor.spin_for(FORWARD, 90, DEGREES)
            wait(5, MSEC)
            
        wait(5, MSEC)

    for repeat_count in range(2):
        arm_motor.spin_for(FORWARD, 300, DEGREES)
        arm_motor.set_stopping(BRAKE)
        drivetrain.turn_for(RIGHT, 90, DEGREES)
        
        for repeat_turn in range(9):
            drivetrain.turn_for(LEFT, 10, DEGREES)
            wait(5, MSEC)
            
        arm_motor.spin_for(REVERSE, 300, DEGREES)
        wait(5, MSEC)

    arm_motor.set_velocity(80, PERCENT)
    drivetrain.set_turn_velocity(65, PERCENT)
    
    for repeat_count in range(2):
        arm_motor.spin_for(FORWARD, 300, DEGREES)
        
        for repeat_turn in range(3):
            drivetrain.turn_for(LEFT, 90, DEGREES)
            drivetrain.turn_for(RIGHT, 90, DEGREES)
            wait(5, MSEC)
            
        arm_motor.spin_for(REVERSE, 300, DEGREES)
        wait(5, MSEC)