Instructional Material: Exercise: Drive in a Circle

Now lets look at an example that drives the robot in a circle. The key idea here is that if you drive the motors in the same direction but at different power levels (speeds) the robot will drive in an arc and if it runs long enough that arc becomes a circle. Here is the code:

Copy and paste this code into a new class called DriveCircle and demonstrate your robot driving in a circle. You will need to adjust the power levels and sleep time to complete the circle. The power levels and time will depend on the motor placement and gearing of your robot.

 

Material Type: 
Lab Activity
Education Level: 
Middle School
High School
Focus Subject: 
Computing / Computer Science
Robotics Software
HW Platform: 
Tetrix
SW Platform: 
Java
Interactivity Style: 
Mixed
Audience: 
Learner