The User Interface Challenge - C++
The User Interface Challenge
In the User Interface Challenge, you will program the Clawbot so that a user can press the brain's screen to control the arm and claw motors. Then the four buttons on the screen will be used to pick up and replace a variety of ten objects. This challenge does not require the Clawbot to drive or turn. The objects are picked up and then replaced to the same spot on the table or floor.
Rules:
- Each of the four buttons must only do one of the four actions: open the claw, close the claw, lift the arm, or lower the arm.
- Using the Controller is not allowed.
- Each Clawbot will need to lift and replace as many objects as possible within one minute and without dropping them. Lifting and replacing one object at a time is recommended.
- The one-minute round ends at the 1-minute mark or if any object is dropped - even if the round is only a few seconds in. Dropping an object disqualifies the team from the full minute of the round but any points earned prior to the drop are counted.
- If all of the provided objects have been lifted before the one-minute round is over, objects can be re-used until time is called.
- The object needs to be lifted higher than the arm's motor before it is replaced on the table.
- Each object successfully grabbed and lifted up then down and replaced is worth one point.
- Between rounds, roles can be changed but only one user per Clawbot can play each round.
- The group with the most points at the end of all of the rounds, wins!
Roles in the Challenge:
- There should only be one user (the lifter) lifting the objects during each round but groups can switch users between rounds.
- There should be a designated scorekeeper who tallies how many objects each Clawbot is able to lift successfully. Each object successfully replaced is worth one point. After an object is dropped, the Clawbot's turn is over. Multiple rounds can be played. A scoring table is included here but rows can be added for additional groups and rounds. Each group can use their own scoring table or everyone can record on the same one. If multiple groups are using the same score table, write each groups' Clawbot ID or group name in the second column. Also, the scorekeeper should combine the points from each round at the end of the User Interface Challenge for a total score.
- There should be a person assigned to switch objects out from the table: the switcher. Because the Clawbot is not turning or driving, the lifted object will need to be removed and replaced with a new object after each attempt.
- There should be a person assigned to keep track of the time: the timekeeper. Each round is one minute.
- The teacher should provide the objects approved for this challenge prior to starting.
Teacher Tips
-
Remind students that they are only allowed to touch the Clawbot's screen.
-
Only provide objects that are safe for possible dropping: an empty can or water bottle, a VEX cube, an unused piece from the VEX kit, or anything else that will not be permanently damaged by a fall or bounce.
-
Allow observing students to see what the screen of each Clawbot looks like. The rectangles should be the same but each Clawbot's colors will likely differ.
-
Discuss students' opinions about the best color choices either during or after the challenge.
Teacher Toolbox - Solution
Below you will find an example programming solution to this challenge along with a programming rubric, an individual engineering notebook rubric, and a team engineering notebook rubric.
- Example Programming Solution
// Begin project code
event ScreenButtons = event();
void HasScreenButtons() {
Brain.Screen.setFillColor(green);
Brain.Screen.drawRectangle(0, 0, 240, 120);
Brain.Screen.setFillColor(purple);
Brain.Screen.drawRectangle(240, 0, 480, 120);
Brain.Screen.setFillColor(orange);
Brain.Screen.drawRectangle(0, 120, 240, 240);
Brain.Screen.setFillColor(cyan);
Brain.Screen.drawRectangle(240, 120, 480, 240);
wait(1, seconds);
}
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
ScreenButtons(HasScreenButtons);
while (true) {
ScreenButtons.broadcast();
if (Brain.Screen.pressing()) {
if (Brain.Screen.xPosition() < 240) {
if (Brain.Screen.yPosition() < 120) {
ClawMotor.spin(forward);
waitUntil(!Brain.Screen.pressing());
} else {
ClawMotor.spin(reverse);
waitUntil(!Brain.Screen.pressing());
}
} else {
if (Brain.Screen.yPosition() < 120) {
ArmMotor.spin(forward);
waitUntil(!Brain.Screen.pressing());
} else {
ArmMotor.spin(reverse);
waitUntil(!Brain.Screen.pressing());
}
}
ClawMotor.stop();
ArmMotor.stop();
}
wait(5, msec);
}
}
- Programming Rubric - Google Doc / .docx / .pdf
- Engineering Notebook Rubric (Individual) - Google Doc / .docx / .pdf
- Engineering Notebook Rubric (Team) - Google Doc / .docx / .pdf