View Single Post
  #3   Spotlight this post!  
Unread 06-01-2008, 17:15
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Double solonoids

You can hook it to a single Spike. Look at the drawing in the attachment.
Click image for larger version

Name:	Spike.png
Views:	113
Size:	38.8 KB
ID:	5928
For the programming, you would fire each solenoid by setting either side of the spike to 1. Ex:
Code:
 
//Start Compressor Code
relay8_fwd = !rc_dig_in18;  //Turn on the compressor when the pressure sensor is closed
relay8_rev = 0; //Without this, the compressor might run backwards or might not run at all
//End Compressor Code
//Start Pneumatic Piston Code
if (p1_sw_top == 1)  //If you press the thumb button on the joystick plugged into port one... 
	{
		relay1_rev = 0; //Turn off the extend side of the solenoid
		relay1_fwd = 1; //Turn on the retract side of the solenoid
	}
if (p1_sw_trig == 1) //If you press the trigger on the joystick plugged into port one...
	{
		relay1_fwd = 0; //Turn off the retract side of the solenoid
		relay1_rev = 1; //Turn on the extend side of the solenoid
	}
//End Pneumatic Piston Code
With this code, you will plug the relay into relay port 1, the compressor into relay port 8, and the pressure sensor into digital i/o port 18.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364

Last edited by RyanN : 06-01-2008 at 18:02. Reason: Fixed a small error in my drawing.