Design 1 – Flat Track MotorSpeed Version

Listed below is the code (plus descriptions) for Team Earth’s MotorSpeed trial run of the flat track portion. Each description is designated by two asterisk (*) marks and a phrase contained between. These are located to the right of every individual portion of code.

  • motorSpeed(4,15); *Initializes both motors at 15% power.* 
    goToRelativePosition(-295); *Continues power supply to the motors until a distance of -295 ticks is reached (295 ticks forward).* 
    motorSpeed(4,20); *Initializes both motors at 20% power.* 
    goToRelativePosition(-140); *Continues power supply to the motors until a distance of -140 ticks is reached (140 ticks forward).* 
    brake(4); *Cuts power to each motor.* 
    motorSpeed(4,0); *Initializes both motors at 0% power.*(Probably not necessary) 
    goFor(2); *Extends powerless period for 2 seconds* 
    reverse(4); *Reverses polarity of each motor to change direction of propulsion.* 
    motorSpeed(4,20); *Initializes both motors at 20% power.* 
    goFor(2); *Extends powered period for 2 seconds* 
    motorSpeed(4,15); *Initializes both motors at 15% power.* 
    goToRelativePosition(200); *Continues power supply to the motors until a distance of 200 ticks is reached (200 ticks backwards).* 
    brake(4); *Cuts power to each motor.* 
    motorSpeed(4,0); *Initializes both motors at 0% power.*(Probably not necessary) 
    brake(4); *Cuts power to each motor.* (Probably not necessary)