View Single Post
  #5   Spotlight this post!  
Unread 22-02-2010, 19:27
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 674
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Solenoid Code Does Not Work!

Assuming your code is reflecting the connection of channels accurately, the code looks find. However, without knowing what the solenoid configurations are, I would guess there is one more mistake.
Code:
			if (stick->GetRawButton(1) && !btn1state) //button is pressed but not being held
			{
				btn1state = 1;						//button is being pressed
				s1->Set(true);					//activate quick release retract
				Wait(1.0);							//for 2 seconds
				s1->Set(false);					//reset state
				s1->Set(true); <<< Should this be s3???					//activate reset piston extend
				Wait(1.0);
				s3->Set(false);					//restet state
				s2->Set(true);					//activate quick release piston extend
				Wait(1.0);
				s2->Set(false);					//reset state
				s4->Set(true);					//activate reset piston retract
				Wait(1.0);
				s4->Set(false);					//reset state
				
			}
Reply With Quote