View Single Post
  #5   Spotlight this post!  
Unread 27-01-2014, 14:46
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
Re: Help with Programming Pnuematics

Quote:
Originally Posted by peng432 View Post
thanks for the reply,
Our team is using a double solenoid would the code still be the same or would their be any minor changes?
You would use the DoubleSolenoid class instead of the Solenoid class:
Code:
// Create a new DoubleSolenoid with the forward channel in port 1,
// and the reverse channel in port 2
DoubleSolenoid doubleSolenoid = new DoubleSolenoid(1, 2);
In addition, the call to DoubleSolenoid#set() is a bit different than Solenoid#set(). Instead of taking a boolean value, it takes a DoubleSolenoid.Value object:

Code:
// Set the solenoid to the 'forward' position
doubleSolenoid.set(DoubleSolenoid.Value.kForward);
// Set the solenoid to the 'reverse' position
doubleSolenoid.set(DoubleSolenoid.Value.kReverse);
// Set the solenoid to the 'off' position
doubleSolenoid.set(DoubleSolenoid.Value.kOff);
You can find more details in the FRC javadocs, located at "C:\Users\user\sunspotfrcsdk\doc\javadoc\index.html" on any computer that has the FRC Java plugins installed.
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)

Reply With Quote