View Single Post
  #5   Spotlight this post!  
Unread 06-01-2008, 17:20
fimmel's Avatar
fimmel fimmel is offline
Founding Mentor, Team 2370
AKA: Forest Immel
FRC #2370 (iBots 2370)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2005
Location: Castleton, Vermont
Posts: 325
fimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond reputefimmel has a reputation beyond repute
Re: Double solonoids

Quote:
Originally Posted by RyanN View Post
You can hook it to a single Spike. Look at the drawing in the attachment. 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.
quick note you power going into the spike should be on the +12v and GND not M+ and M- ....just for clarification

...forest
__________________