Instructional Material: Example Square Program

Printer-friendly version
#pragma config(Motor,  motorB,          left,          tmotorNormal, PIDControl)
#pragma config(Motor,  motorC,          right,         tmotorNormal, PIDControl)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//


// This Program Might Not work Perfect you have to edit it and make it your own


task main()
{
  while (true)
  {
    motor[left] = 100;
    motor[right] = 100;
    wait10Msec(1000);


    motor[left] = -100;
    motor[right] = 100;
    wait10Msec(1000);


    motor[left] = 100;
    motor[right] = 100;
    wait10Msec(1000);


    motor[left] = 100;
    motor[right] = -100;
    wait10Msec(1000);



    motor[left] = 100;
    motor[right] = 100;
    wait10Msec(1000);


    motor[left] = 100;
    motor[right] = -100;
    wait10Msec(1000);


    motor[left] = 100;
    motor[right] = 100;
    wait10Msec(1000);
  }
}

 

Material Type: 
Demonstration
HW Platform: 
SW Platform: 
Interactivity Style: 
Copyright (c) 2013 by the author. All rights reserved.