Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Java Autonomous? (http://www.chiefdelphi.com/forums/showthread.php?t=104195)

frankthelyon 04-03-2012 17:06

Java Autonomous?
 
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);

ProgrammerMatt 06-03-2012 16:58

Re: Java Autonomous?
 
Quote:

Originally Posted by frankthelyon (Post 1138835)
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);


MorocoMan 09-03-2012 04:03

Re: Java Autonomous?
 
Umm.. correct me if I'm wrong, but the autonomousPeriodic does'nt run in loops until the 15 secs is up? cause if so, you're robot will do the things you want it to do all over again..

RufflesRidge 09-03-2012 06:54

Re: Java Autonomous?
 
Quote:

Originally Posted by MorocoMan (Post 1141297)
Umm.. correct me if I'm wrong, but the autonomousPeriodic does'nt run in loops until the 15 secs is up? cause if so, you're robot will do the things you want it to do all over again..

Yes, the autonomousPeriodic method in the Iterative Template will run each time a packet is received from the Driver's Station (~20ms) if it has completed by then. However, the autonomous method in the Simple Template simply executes once when autonomous is entered.


All times are GMT -5. The time now is 09:48.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi