Go to Post Reputation is a good thing to have. - adammiller3122 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-22-2016, 05:41 PM
ncarvo ncarvo is offline
Registered User
FRC #5473 (Team Spitfire)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2012
Location: Grand Rapids
Posts: 5
ncarvo is an unknown quantity at this point
Pneumatics not working

How do I set my pneumatics to my controller.

I currently have this.
if(liftshooter.getRawButton(1)){
shooter.set(DoubleSolenoid.Value.kForward);
}
else if(liftshooter.getRawButton(3)){
shooter.set(DoubleSolenoid.Value.kReverse);
}
else{
shooter.set(DoubleSolenoid.Value.kOff);
}

Up top I have

DoubleSolenoid shooter = new DoubleSolenoid(4,5);
I assume that 4,5 are the ports, and were sure thats correct, please help, asap.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-23-2016, 05:03 AM
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Pneumatics not working

Try adding the following line to your robotInit() code after your shooter has been constructed:

Code:
LiveWindow.addActuator("Shooter", "Solenoid", shooter);
Deploy your program and put the driver station in "Test" mode instead of "Teleop" mode. This should give you a control to verify that you can operate the solenoid. If you don't see the control, that probably indicates there is an error (look in the console window of the DriverStation for a stack trace). If you see the control, but the solenoid doesn't respond, it indicates an electrical/physical issue.

Next, the code fragment you provided looks like it should work. However, it requires the operator to press and hold the buttons down in order to put the solenoid in the forward or reverse position. As soon as a button is released, the solenoid will go back to the off state - is that what you want it to do?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-24-2016, 02:07 PM
VrewDaive VrewDaive is offline
Registered User
FRC #4284
 
Join Date: Sep 2015
Location: Cincinnati
Posts: 21
VrewDaive is an unknown quantity at this point
Re: Pneumatics not working

This is what our team is using, tell me if it works ( youll have to set the solenoids to whatever yours is named.
Code:
DS.set(DoubleSolenoid.Value.kOff); // sets both Solenoids to off at the beginning of Teleop. 
	    	DS1.set(DoubleSolenoid.Value.kOff);// ^




  if(moveStick.getRawButton(1)) // A Button
	    		   {
	    			   DS1.set(DoubleSolenoid.Value.kReverse); // Lowers pistons to raise robot up
	    			  // DS1.set(DoubleSolenoid.Value.kReverse);
	    		   }
	    		   else 
	    			   if(moveStick.getRawButton(4)) // Y Button
	    			   {
	    				   DS1.set(DoubleSolenoid.Value.kForward); // raises pistons to prepare for ascension
		    			  // DS1.set(DoubleSolenoid.Value.kForward); 
	    				   
	    			   }
basically the solenoids are off at the beginning and only if the button is pressed will the direction of the solenoids change. hope this helps!!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:00 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi