Learning Math and CS with Robotics
Sign In

CSP Unit 3 Lesson 8.4

Linkbot Image Mindstorm Image
Grid Size: S M L Simple View: MinView:
CSP Unit 3 Lesson 8.4

Add code to the traceTriangle function definition that (1) turns on the trace, (2) uses the driveDistance command to move the robot by a sideLength amount, (3) turns the robot left by 120 degrees, (4) uses driveDistance again to trace the next side, and so on for the rest of the triangle. The last command in the function definition should turn off the trace. Then add code to the Workspace that will use driveDistance and turn commands to move the robot to the point (8, 15) and then call the traceTriangle function to draw a red triangle of side length 12 (as shown in blue).

Load Blocks
Workspace Save Show C Edit C Ch Shell Console

Rubbish bin