Grid: | ||
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
Labels: |
|
Font
px
|
Trace Lines: | ||
Robot 1: |
|
Width
px
|
Robot 2: |
|
Width
px
|
Robot 3: |
|
Width
px
|
Robot 4: |
|
Width
px
|
Axes: | x-axis | y-axis | Show Grid |
Grid: | 24x24 inches | 36x36 inches | 72x72 inches |
96x96 inches | 192x192 inches | ||
Quad: | 4 quadrants | 1 quadrant | Hardware |
Units: | US Customary | Metric |
Background: |
![]() |
|
|
|
/* Code generated by RoboBlockly v2.0 */ #include <linkbot.h> double degrees; CLinkbotI robot; double radius = 1.75; double trackwidth = 3.69; // Repositions the robot to the next starting point of the next circle void nextCircle() { robot.drivexyTo(11 * cos(deg2rad(degrees)), 11 * sin(deg2rad(degrees)), radius, trackwidth); robot.turnRight(11, radius, trackwidth); } int count; // Create a circle of given radius void Circle(double radius) { robot.traceOn(); count = 0; while(count < 360) { robot.setSpeed(25, radius); robot.driveDistance(double((radius * (2 * M_PI)))/360, radius); robot.turnRight(1, radius, trackwidth); count = count + 1; } robot.traceOff(); } int count2; degrees = 0; count2 = 0; while(count2 < 20) { robot.traceColor("red", 3); degrees = degrees + -18; Circle(3); nextCircle(); count2 = count2 + 1; }
Problem Statement: Modify the blocks so that the robot traces over the twenty circles. |
|||||||||||