View Single Post
  #3   Spotlight this post!  
Unread 12-02-2011, 18:47
umangv620 umangv620 is offline
Programming Captain
AKA: Umang
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2008
Location: New Jersey
Posts: 80
umangv620 will become famous soon enoughumangv620 will become famous soon enough
Re: Double Solenoid problems

Quote:
Originally Posted by Mark McLeod View Post
Are the opposite cases just blank or are they doing something as well?
Your code seems to be turning the same solenoid On and Off at the same time for Button 6.

If the solenoid is defined as a double solenoid, then you want to use Forward/Reverse, rather than On/Off.
Forward will be one position and Reverse the other.
Here's an example.

On activates the value, but off just stops it. Off doesn't reverse it.
That example would require you to hold button 1 in order for the solenoid to be forward, right?

I tried implenting your toggle code, and it does go forward when i hit button 1(and stays that way after I let go), but it doesn't reverse after I press button 1 again. How would I go about combining both code snippets?
__________________
Team 1403 Cougar Robotics

2009-2011 Programming Captain

2010
NJ-Regional - Chairmans Award
Reply With Quote