Is it possible to program a move forward command with a move arm motor command simultaneously?
Yes. Using the SetMultipleMotors will start them simultaneously, then StopMotor will stop them individually.
Yes, but how do I designate distance to travel and how many rotations to raise or lower the arm?
Thank you for your response
Susan
2011 Pan Pacific Pit Map.pdf (672 KB)
2011 Pan Pacific Team List.pdf (134 KB)
SetMotor() commands will start motors with a certain force setting from 0 to 100, so it is suitable for speed adjustments. Stopping a SetMotor() command usually involves a StopMotor() command, often following a WaitUntil() statement. They can start different motors simultaneously but halting them separately may be done in principle, but may not be feasible, especially if the motors are doing very different jobs (like raising an arm and moving forward).
MoveMotor commands will move a motor a certain number of revolutions(or seconds). These commands will not allow another command to execute until they finish, so simultaneous execution is not possible with MoveMotor commands.
In the case of the Clawbot my students usually raise the arm first so it does not catch on the ground and it also exposes a bump switch. They use MoveMotor(armMotor, 0.5 rotations, at 50%), then they can use SetMultipleMotors(leftMotor, rightMotor, none, none, 50) to move the Clawbot forward with a WaitUntil(bumpswitch = true) and StopAllMotors().
Hope this helps. For what it is worth, what you are asking for is easily done outside of the Graphical RobotC with Task()
At first, I though this must be really easy but when I looked, it seemed a bit harder. This is untested, but how about something like the attached?
Looks like a nice solution to a thorny problem, calvc01