Go to Post I don't hate many things, but time-wasting and false dilemmas are amongst the few. - Manoel [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 04-03-2012, 17:06
frankthelyon frankthelyon is offline
Registered User
FRC #2557
 
Join Date: Jan 2012
Location: Tacoma
Posts: 23
frankthelyon is an unknown quantity at this point
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);
Reply With Quote
  #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
  #3   Spotlight this post!  
Unread 09-03-2012, 04:03
MorocoMan MorocoMan is offline
Registered User
FRC #2212
 
Join Date: Mar 2012
Location: Isreal
Posts: 9
MorocoMan is an unknown quantity at this point
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..
Reply With Quote
  #4   Spotlight this post!  
Unread 09-03-2012, 06:54
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Java Autonomous?

Quote:
Originally Posted by MorocoMan View Post
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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