Constraints and Criteria
Constraints List
Position the robot on the home base
Robot automatically maneuvers to avoid the black line
Robot retrieves "fuel" and brings it back to base
Criteria List
Navigate the path without running over the boundaries.
Smoothly pick up and hold fuel containers
All functions programmed on the robot work as planned
Code
#pragma config(Sensor, in1,    l,              sensorLineFollower)
#pragma config(Sensor, in2,    c,              sensorLineFollower)
#pragma config(Sensor, in3,    r,              sensorLineFollower)
#pragma config(Motor,  port2,           rm,            tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor,  port4,           claw,          tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port10,          lm,            tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
task main()
{
    setServo(claw, -127);
    
    wait(1);
    startMotor(lm,-25);
    startMotor(rm,25);
    untilDark(2050, c);
    stopMotor(lm);
    stopMotor(rm);
    setServo(claw, 127);
    wait(2);
    startMotor(lm,50);
    startMotor(rm,-50);
    wait(2);
}

You may also like