View Single Post
  #2   Spotlight this post!  
Unread 29-01-2010, 16:56
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Programming help go foward but not reverse

you are turning it off
Code:
if (armjoy.GetRawButton(outtakeButton) == 1) {
			roller.SetDirection(Relay::kForwardOnly);
			roller.Set(Relay::kOn);
		} else if (armjoy.GetRawButton(intakeButton) == 1) {
			roller.SetDirection(Relay::kReverseOnly);
			roller.Set(Relay::kOn);//not kOff
		} else {
			roller.Set(Relay::kOff);
		}

	if (armjoy.GetTrigger() == 1) {
				winch.SetDirection(Relay::kForwardOnly);
				winch.Set(Relay::kOn);
		} else if (armjoy.GetRawButton(winchDownButton) == 1) {
				winch.SetDirection(Relay::kReverseOnly);
				winch.Set(Relay::kOn);//not kOff
		} else {
				winch.Set(Relay::kOff);
		}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib