No announcement yet.

Autonomous Programming

  • Filter
  • Time
  • Show
Clear All
new posts

  • Autonomous Programming

    My students wanted to put two motors on one arm shaft so they were not overworking one motor for the high hang (we already compounded the gears). We programmed it for "driver" control and it was fairly simple. However, when we tried to write our "Autonomous" program, we could not get the two motors to work together at the same time. Can anyone help us with Autonomous programming for lifting an arm with two motors?

  • #2
    What programming language are you using?


    • #3
      We are using RobotC Graphical.


      • #4
        begrigsby You can just use the setMotorTarget command for that. So, say your arm is in the down position and to move it up ready to hang you need to rotate the motor through 720 degrees at 50% power, you could use:

        setMotorTarget(motorA, 720,50);
        setMotorTarget(motorB, 720,50);

        then move forward or whatever you need to do, then to move the arm back down at 100% power:

        setMotorTarget(motorA, -720,50);
        setMotorTarget(motorB, -720,50);

        The program won't wait for the first move to finish before starting the second, so they will appear to happen at exactly the same time.

        See attached graphical example. Oh, you need to be in at least Expert mode to see this command - Window --> Menu Level --> Expert.