View Single Post
  #2   Spotlight this post!  
Unread 06-03-2012, 16:58
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Java Autonomous?

Quote:
Originally Posted by frankthelyon View Post
I'm new to FRC java, and I was wondering if this is the correct code for what I am trying to do. Here is what I want it to do:
1. Start up rollers
2. Wait a few seconds for motors to speed up
3. Fire solenoid
4. Turn off rollers, solenoid

Here is the code I have right now:
shooter1.set(-.5);
shooter2.set(-.75);
//wait for motors to warm up
Timer.delay(2);
//activate kicker solenoid
Kicker.set(true);
//wait 1 second
Timer.delay(1);
//turn off solenoid, shooter motors
Kicker.set(false);
shooter1.set(0);
shooter2.set(0);
Yessir that is fine, also please use the code boxes like so

Code:
shooter1.set(-.5);
shooter2.set(-.75);
//wait for motors to warm up
Timer.delay(2);
//activate kicker solenoid
Kicker.set(true);
//wait 1 second
Timer.delay(1);
//turn off solenoid, shooter motors
Kicker.set(false);
shooter1.set(0);
shooter2.set(0);
Reply With Quote