FTC Motor Encoders

From wikidb
Jump to: navigation, search

Resources

Example Code

Exercises

  1. Measure how far the robot travels with an encoder count of 5000. Change the speed and remeasure. How accurate is distance traveled compared to motor speed.
  2. The Drive Straight Code above controls the motors so that the speed of the motor is set and constant. Convert this program to one where the power applied to each motor is constant. Stop the motors after 3 seconds.
  3. Start with the Drive Straight Code above to create a program that drives straight until it reaches a colored sheet of paper.
  4. Adapt your code above to determine which mineral is ahead of it and move it. I suspect this is hard and may not be achievable at this point. What are the challenges you are encountering and how might your overcome them?
  5. Compare how the Drive Straight Code above and the other programs we have seen so far, for example Sensor Color from lesson 2, implement state. What are the advantages and disadvantages of these two approaches? (Note: the Drive With Encoder code was used as a starting point for the Drive Straight Code.)

Solutions