Go to Post Anything is capable of happening in FIRST. - Dorienne [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

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 4.33 average. Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 11-12-2013, 13:32
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Beginner FRC Java Programmer - Help

Javadocs for the 2013 season are here: http://team2168.org/javadoc/
This likely will be updated once 2014 code is available.

The Solenoid class(es) and the Relay class can both be used to achieve motion of a pneumatic cylinder. The difference between them is in the type of hardware each one controls.

As you noted, the Relay class controls a Spike. The Spike would have it's M+ and M- terminals connected to the red wires on the solenoid (assuming the valve has two solenoids on it). The black wires from the two solenoids would be tied together and brought back to the power distribution board or DSC ground.

The Solenoid and DoubleSolenoid classes take the spike out of the equation. They control the same solenoid valve hardware, but through the NI relay module (9472), which resides in the 3rd slot of the cRIO.

Also, for the compressor... take a look at the javadoc for the Compressor class. The constructor needs two parameters: the location of the pressure switch and the location of the relay turning the compressor on/off. If you've wired things up right, this is a set-it-and-forget-it class. Al you need to do is enable the compressor and it will automatically turn itself on and off. I would suggest placing compressor code in the robotInit() method as follows:
Code:
Compressor compressor;
int switchChannel = 1; //wherever these are plugged in on the DSC
int relayChannel = 1;

robotInit() {
  compressor = new Compressor(switchChannel, relayChannel);
  compressor.start();
}
What you had would work, but moving the compressor code out of the auto method helps to organize the code a bit better IMO.
__________________
http://team2168.org

Last edited by otherguy : 11-12-2013 at 13:42. Reason: compressor details
Reply With Quote
 


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 12:07.

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