Font size
WorksheetsPLTW POE 3.1 Machine Control Review RobotC
Total questions: 209
Worksheet time: 2hrs 52mins
a type of touch sensor for the VEX. Due to its size and construction, it is better suited for tasks such as wall detection.
Algorithm
Bumper Switch
Data
an array of 4 LEDs that helps your robot light the way
Flashlight
Data
debugger
Information fed into a data processing system or computer.
Interface
Limit Switch
Input
allows the robot to sense the ambient light in a room.
Flashlight
Light Sensor
Limit Switch
another form of touch sensor for VEX. It is more suited for detecting smaller motions that might not trigger the bumper sensor.
Limit Switch
Line Tracking Sensor
Flowchart
allows the robot to tell objects or surfaces apart based on how dark or light they are. It shines a beam of infrared light out onto the object, and measures how much light is reflected back.
Optical Encoder
Line Tracking Sensor
Potentiometer
detects the rotation of an axle that passes through it. It has a resolution of 360 counts per revolution (2 count intervals), and can distinguish between clockwise and counterclockwise rotation.
Potentiometers
Optical Encoder
Limit Switch
used to measure the angular position of the axle or shaft passed through its center.
Potentiometers
Limit Switch
Bumper Switch
By emitting an ultrasonic pulse and timing how long it takes to hear an echo,it can accurately estimate how far away the object is.
Potentiometers
Light Sensor
Ultrasonic Range Finder
Analog sensor senses ambient light in the room; returns values in range of 0 to 4095.
Limit Switch
Light Sensor
Bumper Switch
Reed Sensor
Digital sensor; returns distance values between 0 and 255 inches; uses sonar
Ultrasonic Rangefinder
Light Sensor
Shaft Encoder
Bumper Switch
A switch that can provide variable motion control (rotational). It can vary the resistance within the switch, which affects both the current and voltage flowing out of the switch.
Limit Switch
Sensor
Potentiometer
Analog Signal
A digital Vex touch sensor best suited to smaller motions that might not be triggered by the bumper sensor.
Reed Switch
Light Sensor
Bumper Switch
Limit Switch
A specialized digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or lighting fixtures.
Analog Signal
Potentiometer
Cortex or Programmable Logic Controller
Analog Signal
Programming can be done in real time.
Open loop system
Closed loop system
Boolean
Data
A digital Vex touch sensor best suited to tasks such as wall detection.
Limit Switch
Bumper Switch
Reed Switch
Potentiometer
Coding where a single input creates a continuous output.
Open loop system
Closed Loop System
Data
Analog Signal
"Plain english" computer program that is written in green on RobotC, intended for human reading rather than machine.
Boolean
Subroutine
Pseudocode
Limit Switch
A diagram that shows step-by-step progression through a procedure using connecting lines and a set of conventional symbols.
Flowchart
Data
Sensor
Loop System
Similar appearance to a motor; rotates to a position between 0 to 120 degree; Does not spin continuously
Motor
Servo
Potentiometer
Reed Switch
an array of 4 LEDs that helps your robot light the way
Flashlight
Data
debugger
In the command, wait(9); the 9 represents what value?
Speed of the motor
Time of the motor running
Time between tasks
Find the error in this code.
turnLEDOff(red);
turnLEDOff(yellow)
turnLEDOff(green);
turnLEDOn(red);
untilTouch(touchSensor);
turnLEDOff(red);
Missing a parameter
Missing a semicolon
Reversed parameters
Wrong notation for name of sensor/command
All of these are digital sensors except?
bumpswitch
light sensor
shaft encoder
ultrasonic range finder
The value range associated with the limit switch is?
-127 to 127
0 to 127
-1 to 1
0 or 1
An axle in your optical shaft encoder rotated exactly 1 revolution. How can you know this by looking at sensor data?
it changed from 0 to 1
it increased by 3.14 times
it shows a change of 360
it can't be known by looking at the data
One of the first things you should do every day after opening the ROBOTC software is:
check my texts & Instagram when I think the teacher isn't looking and send a selfie to my BFF
pat my head and rub my tummy at the same time
check the student splash page to see if I've won the lottery
update the firmware
Comments in ROBOTC are what color text?
Blue
Green
Orange
Red
This shape represents what in a flowchart?
Decision
Process
Input/Output
Start or Stop
A motor can be reversed by_____________.
Standing on my head and looking at the motor upside down
changing the sign (+/-) of the speed in the program
Check "Reverse" in Motors & Setup
turn the motor with my LEFT hand instead of my right hand
Which battery condition allows the fastest motor rotation?
50% charged
75% charged
100% charged
charged to my credit card
Find the error in this code.
turnLEDOff(red);
turnLEDOff(yellow)
turnLEDOff(green);
turnLEDOn(red);
untilTouch(touchSensor);
turnLEDOff(red);
Missing a parameter
Missing a semicolon
Reversed parameters
Wrong notation for name of sensor/command
Which statement below best describes a potentiometer?
It can turn up to 12 full revolutions
Measures rotation of a shaft
between 0 and ~265 degrees
Excess torque against the internal mechanical stops will not harm them
It measures potential energy
Which of the following are true for the Ultra Sonic Range Finder?
It works similar to how bats and submarines
sense distance
Returns values of -1 or -2 if used outside of this range or if a return signal is not sensed
Is an analog sensor
It returns distance values between 0 and 255 inches or the equivalent centimeters or millimeters
This sensor can control the distance which a robot moves by monitoring the angle at which the wheels attached to the shaft encoder spin. Which sensor is it?
Flashlight
Motors
Potentiometer
Optical Shaft Encoders
The line follower prefers what color to operate?
White
Black
Yellow
Sky Blue
I use pseudocode & comments in my program because _____.
my teacher is mean and makes me do it.
I follow sound best practices and know it can help me or a teammate save time in the future.
I just like to do pseudo - anything
my teacher won't let us program a poem.
It used, in ROBOTC, to confirm that all inputs and outputs are working as expected
Debugger
Timers
Comments
Pseudocode
Which data type uses True or False and is useful for representing truth values of logic.
Bounce
Debugger
Timers
Boolean
What is the purpose of the 'while(true)' statement?
creates a finite loop to check for changes in your VEX components a number of times
creates a finite loop to check for changes in your VEX components a number of times
creates an infinite loop to continually check for changes in your VEX components
True or False: You can use a variable simply by putting its name where you want its value to be used
True
False
True or False: The current value of the variable will be used every time the variable appears
True
False
How do we make a program loop indefinitely?
if/else statements
task main ()
while (1==1)
SensorValue ()
Which is NOT an acceptable example of an infinite loop?
while(true)
while(1==1)
while(not false)
What speed is this program running?
Full Speed
Half speed
A program is
A logical and step-by-step set of directions for the robot to follow.
A logical and step-by-step set of directions for the programmer to follow.
A set of directions, written in paragraph form, that even a robot can follow.
True or False: The role of the robot is to carry out the plan by following the steps in the program.
True
False
When is the while loop true?
Never
Always
When hit bumpSwitch
limitStwitch
Value of bump switch when pressed
0
1
63
127
A motor can be reversed by_____________.
(multi-answer)
Standing on my head and looking at the motor upside down
Flipping the polarity (+/-) at the connection to the cortex microcontroller
Check "Reverse" in Motors & Setup Pragma
turn the motor with my LEFT hand instead of my right hand
The following statement is an example of what kind of behavior: "startMotor (port2, 127);"
Complex behavior
Simple behavior
Basic behavior
The following statement is an example of what kind of behavior: "Turn on both motors at full speed"
Complex behavior
Simple behavior
Basic behavior
What will happen in this program?
Robot will turn left
Robot will turn right
robot will move forward for 2 seconds
Robot will move backward for 2 seconds
In a ROBOTC program, this is an example of what?
Complex behaviors
Simple behaviors
Basic behaviors
Pseudocode
True or False: Comments are used to make notes for the human programmers
True
False
True or False: Program comments will be read as code and executed by ROBOTC.
True
False
Limit and bump switches are what?
Analog Sensors
Motors
Batteries
Digital Sensors
What does it mean when a command appears in color when typed in ROBOTC?
command is not allowed
command is typed incorrectly
ROBOTC recognizes the command as an important keyword
Every time you open ROBOTC on your computer desktop, you should check for these things... Which is the correct path to follow?
Robot > Platform type > VEX 2.0 Cortex and Natural Language PLTW; Robot > VEX Cortex Communication Mode > USB Only
Robot > Compile Program; Robot > VEX Communication Mode > VEX net or USB; View > Font Increase
Robot > Compiler Target > Physical Robot; Robot > VEX Cortex Communication Mode > Competition VEXnet
ROBOTC is a _________________ programming language based on the standard C programming language.
message
text-based
data
conditional
Text written as part of a program is called _______
byte
bitmap
function
code
You type code just like normal text, but you must keep in mind that ___________________ is important to the computer. Replacing a lowercase letter with a capital letter or a capital letter with lowercase, will cause the robot to become confused.
spaces
capitalization
letters
numbers
3000 milliseconds is the same as
3 minutes
3 hours
3 seconds
3ml
Statements run in English reading order. As soon as one command is complete, the next runs.
(right-to-left, top-to-bottom).
(left-to-right, bottom-to-top).
(left-to-right, top-to-bottom).
(right-to-left, bottom-to-top).
When the program runs out of statements and reaches the ____ symbol in task main, all motors stop, and the program ends.
]
;
{
}
How does RobotC know where one statement ended and the other began?
It knows because of the semicolon at the end of each line.
It knows because of the curly brackets at the end of each line.
It knows because of the square brackets at the end of each line.
It knows because of the bracket at the end of each line.
Every __________________ ends with a semicolon. It’s like the period at the end of a sentence.
sentence
code
statement
option
Every punctuation pair consists of an “_______” punctuation mark and a “________” punctuation mark.
"first" "last"
"starter" "ending"
"initial" "ending"
"opening" "closing"
Different commands make use of different punctuation. The motor command uses square brackets and the wait1Msec command uses _____________.
curly brackets
parentheses
square brackets
semi-colon
Simple statements can only run one after another in order, but __________ statements allow the program to choose the order that statements are run.
command
instructional
running
control
The control structure “___________” directs the program to the main body of the code. When you press “Start” or “Run” on the robot, the program immediately goes to task main and runs its code.
task main
starting up
main body
body start
The left and right curly braces { } belong to the_________structure. They surround the commands which will be run in the program
running
main body
command
task main
Normally, statements run only once, but with a __________, they can be told to repeat over and over for as long as you want
while loop
repeater
duplicator
infinity runner
Control structures like ________ decide which lines of code are run, and when. They control the “flow” of your program, and are vital to your robot’s ability to make decisions and respond intelligently to its environment.
task main
run
main body
main command
For this, ROBOTC allows “comments” to be made. It starts with _____
"
(
//
[
Punctuation, both single like semicolons and paired like parentheses, are used to set apart important parts of ___________
words
sentences
commands
paragraphs
ROBOTC automatically _________ key words that it recognizes
counts
weighs
colors
marks
Spaces, tabs, and line breaks are generally unimportant to ROBOTC and the robot. True or False
True
False
Sometimes true
Always False
Statements are commands to the robot. Each statement e is also usually written on its own line to make it ________.
easier for the robot to read
organized
neat
easier for humans to read.
1. A program is
A logical and step-by-step set of directions for the robot to follow.
A logical and step-by-step set of directions for the programmer to follow.
A set of directions, written in paragraph form, that even a robot can follow.
D. None of the answers are correct.
2. True or False: The role of the robot is to carry out the plan by following the steps in the program.
True
False
Sometimes true
Always false
Pseudocode is
A false code
A code, written in English, that the robot can understand.
A code, written in binary language, that the robot can understand.
A set of basic steps that the human can use to plan the program.
________ are a convenient way to talk about what the robot is doing and what it must do to carry out the plan created by the programmer.
Operations
Actions
Behaviors
Instructions
Which of the following is a reason that programmers use pseudocode?
It keeps the plan for the program organized.
Writing out the exact code commands takes too much time.
It allows people who can’t read code to understand the plan for the program.
All of the answers are true.
In a ROBOTC program, this is an example of what?
Complex behaviors
Simple behaviors
Basic behaviors
Pseudocode
What color are the comments in RobotC?
red
black
blue
green
Which is an example of program comments; A or B?
A
B
Which menu would you click on to add motors to your program?
Motor and Sensor Set-up
Firmware Download
Compile Program
Download to Robot
Value of bump switch when pressed
0
1
63
127
What is the purpose of the 'while(true)' statement?
creates a finite loop to check for changes in your VEX components a number of times
creates an infinite loop to check for mistakes in the program functions
creates a finite loop to check for mistakes in the program functions
creates an infinite loop to continually check for changes in your VEX components
When is the while loop true?
Never
Always
When hit bumpSwitch
limitStwitch
Which data type uses True or False and is useful for representing truth values of logic.
Bounce
Debugger
Timers
Boolean
True or False: You can use a variable simply by putting its name where you want its value to be used
True
False
Which are three main steps involved in using a variable?
Introduce (create or “declare”) the variable
Give (“the assigned”) variable a name
Use the variable to access the stored value
Introduce (create or “declare”) the variable
Use the variable to access the stored value
Give (“the assigned”) variable a name
Give (“the assigned”) variable a name
Introduce (create or “declare”) the variable
Use the variable to access the stored value
Normally, statements run only once, but with a __________, they can be told to repeat over and over for as long as you want
while loop
repeater
duplicator
infinity runner
Limit and bump switches are what?
Analog Sensors
Motors
Batteries
Digital Sensors
What do these instructions tell the robot to do?
Move backwards for 63 seconds
Move backwards for 2 seconds at half speed
Turn in circles for for 2 seconds
Wait 2 seconds before moving backwards 63 inches
What do these instructions tell the robot to do?
Make a left swing turn
Make a left point turn
Make a right swing turn
Make a right point turn
What do these instructions tell the robot to do?
Make a left swing turn
Make a left point turn
Make a right swing turn
Make a right point turn
It used, in ROBOTC, to confirm that all inputs and outputs are working as expected
Debugger
Timers
Comments
Pseudocode
Some punctuation comes in pairs, like parentheses () and curly braces {}. What will happen if one of the pair are missing?
the robot will assume that it is there and continue running
the program will not compile and the programmer will see an error message
the program will skip the statement
the program will delete the paired punctuation that is not missing
How would you fix the error on line 2 in this program?
add “ { ” (open bracket)
add “ } “ (closed bracket)
line is not needed - delete line
add a ‘ ; ” at the end of the line
How would you fix the error on line 1 in this program?
add “ { ” (open bracket)
“task main” needs to be one word “taskmain”
add “ ) “ (closed parenthesis)
add a “ ; ” at the end of the line
How would you fix the error on line 7 in this program?
“stopMotor” needs to be “Stopmotor"
should be written as (63, leftMotor)
speed should be “127” instead of “63 “
There is no speed when stopping a motor.
What does every top to bottom ROBOTC program have to have?
task main( ) and a set of { }
task main and a set of ( )
main task and a set { }
task main and a set of [ ]
Simple ROBOTC command lines always end with a
}
)
semi-colon
]
The most important thing to do when troubleshooting compiled code is:
(multi-answer)
make sure each line has a semicolon(;) at the end
make sure commands are in camalCase
check that all the comments are correct descriptions
check your syntax (programming language)
Which of the following statements are true about comments?
Comments are used by programmers to make notes in their codes
It cuts down on potential confusion when someone else may read the code
The compiler and robot both ignore comments when running the program
All of these statements are true
What are some examples of commands that are Simple Behaviors?
(multi-answer)
startMotor();
wait();
turnLEDOn();
turnLEDOff();
Which of the following are complex behaviors?
Turn on left motor
Turn on right motor
Turn off left motor
Turn off right motor
Reverse left motor
Turn off right motor
Coding to complete labyrinth challenge
Which one of these representations of Task Main will work in ROBOTC?
Task main ()
task main ()
Taskmain ()
task main;
What does it mean when a command appears in color when typed in ROBOTC?
The command is typed incorrectly
ROBOTC recognizes the command as an important keyword
The command is not allowed in the command
So the programmer should look at the word or name carefully
The purpose of 'whitespaces' (add some space between segments) is:
To allow the robot to understand the program better
To speed the operation of the robot
To make the program more readable to the programmer
To slow the operation of the robot
If there are no more statements to run in the program:
Continue its last statement until it can find another one
Continue its last statement until it can find the Stop command
The robot will go back to the beginning and start all over
The robot will stop
After task main() you put your code...
directly after task main()
inside of ( ) after task main()
directly before task main()
Inside { } after task main()
True or False: You need a ; (semicolon) after ever line of code
True
false
To make a robot perform a task for 8 seconds, which line of code is correct?
(multi-answer)
stopFor(8);
waitUntil(8000);
wait(8);
wait1Msec(8000);
What is the proper way to make Single-Line Comment additional to code?
// comment
/* comment */
\\ comment
! comment !
True or False: You can use pragma to change the names of the motors in your code?
True
False
What is the proper way to create a Multi-Line Comment additional to code?
" comment "
/* comment */
/ comment /
// comment
Find the error in this block of code.
turnLEDOff(red);
turnLEDOff(yellow)
turnLEDOff(green);
turnLEDOn(red);
untilTouch(touchSensor);
turnLEDOff(red);
Missing a parameter
Missing a semicolon
Reversed parameters
Wrong notation for name of sensor/command
Pseudocode is
A false code
to be perfect and detailed
A code, written in machine(binary) language, that the robot can understand.
A description of a task that a human can use to code the program
________ are a convenient way to talk about what the robot is doing and what it must do to carry out the plan created by the programmer.
Operations
Actions
Behaviors
Instructions
Which of the following is a reason that programmers use pseudocode?
It keeps the plan for the program organized
Writing out the exact code commands takes too much time.
It allows people who can’t read code to understand the plan for the program.
All of the answers are true.
When you press a button, which command would be used?
untilTouch
untilBump
startMotor
wait
When you use a ultrasonic range finder, which command would be used?
untilTouch
untilSonarLessThan
startMotor
waitInMilliseconds
Which part do we write code in?
1
2
3
4
Comments in ROBOTC are what color text?
Blue
Green
Orange
Red
It used, in ROBOTC, to confirm that all inputs and outputs are working as expected
Debugger
Timers
Comments
Pseudocode
Which data type uses True or False and is useful for representing truth values of logic.
Bounce
Debugger
Timers
Boolean
What is the purpose of the 'while(true)' statement?
creates a finite loop to check for changes in your VEX components a number of times
creates a finite loop to check for changes in your VEX components a number of times
creates an infinite loop to continually check for changes in your VEX components
True or False: You can use a variable simply by putting its name where you want its value to be used
True
False
True or False: The current value of the variable will be used every time the variable appears
True
False
How do we make a program loop indefinitely?
if/else statements
task main ()
while (1==1)
SensorValue ()
Which is NOT an acceptable example of an infinite loop?
while(true)
while(1==1)
while(not false)
What speed is this program running?
Full Speed
Half speed
A program is
A logical and step-by-step set of directions for the robot to follow.
A logical and step-by-step set of directions for the programmer to follow.
A set of directions, written in paragraph form, that even a robot can follow.
True or False: The role of the robot is to carry out the plan by following the steps in the program.
True
False
When is the while loop true?
Never
Always
When hit bumpSwitch
limitStwitch
Value of bump switch when pressed
0
1
63
127
A motor can be reversed by_____________.
(multi-answer)
Standing on my head and looking at the motor upside down
Flipping the polarity (+/-) at the connection to the cortex microcontroller
Check "Reverse" in Motors & Setup Pragma
turn the motor with my LEFT hand instead of my right hand
The following statement is an example of what kind of behavior: "startMotor (port2, 127);"
Complex behavior
Simple behavior
Basic behavior
The following statement is an example of what kind of behavior: "Turn on both motors at full speed"
Complex behavior
Simple behavior
Basic behavior
What will happen in this program?
Robot will turn left
Robot will turn right
robot will move forward for 2 seconds
Robot will move backward for 2 seconds
In a ROBOTC program, this is an example of what?
Complex behaviors
Simple behaviors
Basic behaviors
Pseudocode
True or False: Comments are used to make notes for the human programmers
True
False
True or False: Program comments will be read as code and executed by ROBOTC.
True
False
Limit and bump switches are what?
Analog Sensors
Motors
Batteries
Digital Sensors
What does it mean when a command appears in color when typed in ROBOTC?
command is not allowed
command is typed incorrectly
ROBOTC recognizes the command as an important keyword
Every time you open ROBOTC on your computer desktop, you should check for these things... Which is the correct path to follow?
Robot > Platform type > VEX 2.0 Cortex and Natural Language PLTW; Robot > VEX Cortex Communication Mode > USB Only
Robot > Compile Program; Robot > VEX Communication Mode > VEX net or USB; View > Font Increase
Robot > Compiler Target > Physical Robot; Robot > VEX Cortex Communication Mode > Competition VEXnet
What software do we use to create programs for our robots?
RobotC
Vex IQ
Lego Mindstorms
Python
How do you open a new template file for new programs?
RobotC/Open File/This Pc/S12345
RobotC/File/Open Sample Programs/Vex2/PLTW/PLTWtemplate.c
VexVR/Load File From Device
Which two settings are accurate for your PLATFORM TYPE?
Vex 2.0 Cortex and Natural Language PLTW
Vex 2.0 Cortex and Natural Language 2.0
Vex IQ and Natural Language PLTW
Vex IQ and Natural Language 2.0
In order to run your robot without the orange USB cord, what should the Vex Cortex Communication mode be set to?
VEXnet or USB
USB only
Competition (VEXnet)
Where is the COMMUNICATION MODE setting found in RobotC?
Click on "File"
Click on "Robot"
Click on "Edit"
Click on "View"
Which menu would you click on to add motors to your program?
Motor and Sensor Set-up
Firmware Download
Compile Program
Download to Robot
Which type of motor do we use in class?
Vex 269
Vex 393
Vex 393 High Speed Motor
Vex 393 Turbo Speed Motor
Which menu would you select to add a BUTTON to your program?
Motor and Sensor Set-up
Firmware Dowload
Compile Program
Download to Robot
What do these instructions tell the robot to do?
Move forward for 63 seconds
Move backwards for 1 second
Move forward for 1 second at half speed
Wait 1 second before moving forward 63 inches
What do these instructions tell the robot to do?
Move backwards for 63 seconds
Move backwards for 2 seconds at half speed
Turn in circles for for 2 seconds
Wait 2 seconds before moving backwards 63 inches
What do these instructions tell the robot to do?
Make a left swing turn
Make a left point turn
Make a right swing turn
Make a right point turn
What do these instructions tell the robot to do?
Make a left swing turn
Make a left point turn
Make a right swing turn
Make a right point turn
What color are the comments in RobotC?
red
black
blue
green
Some punctuation comes in pairs, like parentheses () and curly braces {}. What will happen if one of the pair are missing?
the robot will assume that it is there and continue running
the program will not compile and the programmer will see an error message
the program will skip the statement
the program will delete the paired punctuation that is not missing
How would you fix the error on line 2 in this program?
add “ { ” (open bracket)
add “ } “ (closed bracket)
line is not needed - delete line
add a ‘ ; ” at the end of the line
How would you fix the error on line 1 in this program?
add “ { ” (open bracket)
“task main” needs to be one word “taskmain”
add “ ) “ (closed parenthesis)
add a “ ; ” at the end of the line
How would you fix the error on line 7 in this program?
“stopMotor” needs to be “Stopmotor"
should be written as (63, leftMotor)
speed should be “127” instead of “63 “
There is no speed when stopping a motor.
What is NOT true about #pragma statements at the top of your program?
They set the power levels of the motors.
Their code is automatically generated by ROBOTC configuration wizard.
They tell the robot which sensor/motor is connected to which port.
If your robot is turning in circles, but your code indicates that it should be going forward, which option below will NOT fix the problem?
You can reverse a motor in Motor and Sensor Set-up
You can change the positive/negative signs in your code
You can switch the ports where your drive train motors are plugged in
You can turn one motor off and leave the other motor on
If you download your code and the robot doesn't move, but the green line does move down the page, what might fix the problem?
Click "Firmware Download"
Reverse a motor
Unplug the battery and plug it back in
Click "Fix Formatting"
What might be causing this error?
Wrong Platform Type
Wrong communication mode
Motors are named incorrectly
Capitalization error
Where should students save their RobotC programs?
On the desktop
Not necessary, because the programs auto save on the web
Student drive (look for s + lunch number)
In the same folder as the PLTWtemplate files
What is causing these errors?
Wrong platform type
Wrong communication mode
Capitalization errors
Missing semicolons
What is most likely causing these errors?
Missing semicolons
Wrong platform type
Wrong communication mode
Missing pragma statements at the top
