Go to Post I was dragged to the first team meeting in September my freshman year and a week later, found myself at Fall Classic. Needless to say, after experiencing the heat of a competition, I was in love. ... Robotics has become far more than just that. I get to do the coolest thing in the world. - Audrey Chu [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 26-01-2014, 18:08
peng432 peng432 is offline
Registered User
FRC #3236
 
Join Date: Jan 2014
Location: Franklin
Posts: 3
peng432 is an unknown quantity at this point
Help with Programming Pnuematics

Hi,
Our team recently lost the majority of its programmers and where switching over to Java, i understand java a little and where using robot builder to make it a bit easier. My question is how do you code pneumatic's in general and even then how would you use that in robot builder? I lurked a little to try and find out but my adventure didn't give me anything. So any help would be Greatly appreciated!!
Reply With Quote
  #2   Spotlight this post!  
Unread 27-01-2014, 07:42
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Help with Programming Pnuematics

Quote:
Originally Posted by peng432 View Post
Hi,
Our team recently lost the majority of its programmers and where switching over to Java, i understand java a little and where using robot builder to make it a bit easier. My question is how do you code pneumatic's in general and even then how would you use that in robot builder? I lurked a little to try and find out but my adventure didn't give me anything. So any help would be Greatly appreciated!!
You'll want to create a Solenoid first.
Code:
Solenoid solenoid1 = new Solenoid(1);
Then you'll want to tell the solenoid to activate.

Code:
solenoid1.set(true);
Or deactivate.

Code:
solenoid1.set(false);
If you have a double acting cylinder you'll need teo solenoids and active and deactivate them opposite of each other, or use a DoubleSolenoid.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2014, 14:28
peng432 peng432 is offline
Registered User
FRC #3236
 
Join Date: Jan 2014
Location: Franklin
Posts: 3
peng432 is an unknown quantity at this point
Re: Help with Programming Pnuematics

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?
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2014, 14:42
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
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?
Code:
DoubleSolenoid solenoid = new Solenoid(1, 2);
solenoid.set(DoubleSolenoid.Value.kForward);
kReverse would fire it the opposite direction.

Give that a try. You can also do something like:
Code:
Solenoid solenoid1 = new Solenoid(1);
Solenoid solenoid2 = new Solenoid(2);
solenoid1.set(true);
solenoid2.set(false);
Reply With Quote
  #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
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 13:11.

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