Shaft Encoders Flashcards
What is a shaft encoder?
Shaft encoders are digital sensors that measure the amount of rotation on the shaft, or axle, which passes through its center.
How will the shaft encoders enable you to control the distance you robot travels?
As the axles inside the encoders turn, they “count”. The shaft encoders measure 360 counts per revolution, and count up for forward movements and down for reverse. By monitoring the axles connected to your robot’s wheels, the encoders allow you to control the overall distance the robot travels.
What are some of the problems with the earlier movement-based programs that didn’t use shaft encoders.
The manual adjustments made to the power levels weren’t the same for every robot, and as the battery power drains, the robot will travel shorter and shorter distances in the same amount of time.
Should you edit pragma statements manually?
No. Pragma statements should only be edited using the ROBOTC motors and sensors setup menu.
Can you plug in the two wires of the encoder into any of the digital ports?
No. The two encoder wires must be plugged into adjacent digital ports on the cortex.
Why is clearing the encoder values important?
Clearing the encoders before every use improves the consistency and precision of the robots movements.
What is a while loop?
A while loop is used to repeat the code between the curly braces “while” the code between the parenthesis (the condition) is true.
What are the three main parts of a while loop?
Part 1 - The “while” command
Part 2 - The condition, to control when the loop stops
Part 3 - The body of code that is looped
Where are pragma statements found?
They are located at the top of the program.