View Single Post
  #8   Spotlight this post!  
Unread 21-02-2010, 22:08
KayyPii's Avatar
KayyPii KayyPii is offline
Registered User
FRC #1404 (SHOCKs)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: Toronto
Posts: 45
KayyPii will become famous soon enough
Re: solenoid problems

Code:
Solenoid kicker = new Solenoid ( 7, 1 ); //locate a solenoid on slot 7 of cRio and channel 1 on the solenoid breakout.
if ( pup.getButton( Joystick.ButtonType.kTrigger ) == true ) //if the switch is pressed
         kicker.set(true); //turn on the solenoid
else
         kicker.set(false); //turn off the solenoid
That is pretty much our code for our kicker with the few changes to the variable names. Also, I believe that when you initialize the solenoid to channel 1, it is the first channel on the breakout board. I think its labelled as 0. Hope this helps
__________________
=>"That hole you drilled is a little off."
=>"Don't panic, just make it bigger and put a washer on it!"

=>Eye ball once, and cut as many times as it takes

Reply With Quote