HTML icon

[PROJECT] drillbot.c

HTML | PRO | 12/19/17 11:22:08 AM UTC | 0 ⭐ | 411 👁️ | Never ⏰ | []
C |

1.15 KB

|

None

|

0 👍

/

0 👎

#pragma config(Motor,  port2,           track2,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port3,           track1,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port8,           pivot1,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port9,           drill1,        tmotorServoStandard, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
 
task main()
{
    // the head rotates the arm outward about 90 degrees to meet the object
    startMotor(pivot1,-15);
    wait(1);
    stopMotor(pivot1);
    // track moves forward a couple inches
  startMotor(track1,17.5);
    startMotor(track2,17.5);
    wait(1);
    stopMotor(track1);
    stopMotor(track2);
    // the drill end of the arm turns for a few seconds to drill the object
    startMotor(drill1,100);
    wait(3);
    stopMotor(drill1);
    // track moves backward to it's original position to deliver part
    startMotor(track1,-17.5);
    startMotor(track2,-17.5);
    wait(1);
    stopMotor(track1);
    stopMotor(track2);
    // the head rotates the arm back to it's original position, out of the way
    startMotor(pivot1,15);
    wait(1);
    stopMotor(pivot1);
}

Comments