Quiz+5-9

Quiz 5-9:

Write a program that would make your Robot traverse a square using functions. Note: each leg of the square is assumed to take 2 seconds at 50% power. Good Luck!

void Straight { motor[motorB]=50; motor[motorC]=50; wait1Msec(2000); }

void Turn { motor[motorB]=0; T1 motor[motorC]=50; wait1Msec(400); }

task main { <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Straight; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Turn; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;"> <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Straight; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Turn; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Straight; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Turn; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Straight; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Turn; }