Published on STEMRobotics (https://stemrobotics.cs.pdx.edu)

Home > Example Square Program

Example Square Program

Submitted by owenjas on 9 March, 2013 - 16:44
#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
Education Level: 
Grade 6 [1]
Grade 7 [2]
Grade 8 [3]
Grade 9 [4]
Grade 10 [5]
Grade 11 [6]
Grade 12 [7]
HW Platform: 
NXT [8]
SW Platform: 
Robot-C [9]
Interactivity Style: 
Expositive [10]



National Science Foundation

Source URL: https://stemrobotics.cs.pdx.edu/node/2483

Links
[1] https://stemrobotics.cs.pdx.edu/taxonomy/term/31
[2] https://stemrobotics.cs.pdx.edu/taxonomy/term/32
[3] https://stemrobotics.cs.pdx.edu/taxonomy/term/33
[4] https://stemrobotics.cs.pdx.edu/taxonomy/term/34
[5] https://stemrobotics.cs.pdx.edu/taxonomy/term/35
[6] https://stemrobotics.cs.pdx.edu/taxonomy/term/36
[7] https://stemrobotics.cs.pdx.edu/taxonomy/term/37
[8] https://stemrobotics.cs.pdx.edu/target-hardwareplatform/nxt
[9] https://stemrobotics.cs.pdx.edu/target-software-platform/robot-c
[10] https://stemrobotics.cs.pdx.edu/taxonomy/term/25