![]() |
Sequences of Commands
We had trouble getting a command to work after another command in autonomous mode. We used a while statement and ended the command with a limit switch changing states, but the next command did not trigger the pnuematic cylinder to fire. Any hints?
|
Re: Sequences of Commands
This is a situation where you will want to use CommandGroups.
|
Re: Sequences of Commands
Quote:
|
Re: Sequences of Commands
Quote:
void shoot() { latchPneumatic.set(DoubleSolenoid.Value.kReverse); } void winch(int direction, double unwindTime) { if (direction == 1) { while (catapultLimitSwitch.get() == true) { winchMotor.set(1); } //latchPneumatic.set(DoubleSolenoid.Value.kReverse); winchMotor.set(0); } else if (direction == -1) { for (int i = 0; i < unwindTime*10000; i++) winchMotor.set(-1); winchMotor.set(0); } else winchMotor.set(0); } |
Re: Sequences of Commands
Quote:
Code:
public void execute() {Code:
shooter.winch(x)Code:
public boolean isFinished() {Code:
public void end() { |
Re: Sequences of Commands
This is why I like being involve with FRC. I appreciate all the tips and advice.
Thanks to everyone who responded. The information will be put to good use on Saturday when our programming group get together to work on this small project for preparation for the new game in January. Thanks again William |
| All times are GMT -5. The time now is 22:37. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi