Go to Post You know what they call the graduate with the lowest GPA in med school? Doctor. You know what they call the fourth robot in the alliance that wins Einstein? Champion. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Spotlight this post!  
Unread 27-11-2007, 11:52
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: in case of EMERGENCY, is a loop of NOPs an option?

Okay... but why use nops? You really should (and its more stable this way) write your code re-entrantly, so that it can freely loop as the system lends itself to.

Personally, even when dead-reckoning a machine, I like to write a script executer so I have a simplified language i can quickly write autonomous scripts in (case in point, the debut of RALFF on our sweet 2006 adaptive autonomous mode) and lets you have multiple programs loaded that are switch-selectable at match time with either jumpers, toggle switches, or (my favorite) a hex-wheel encoder. Its a nice system... all you have to do is sit down with your strategist/driver and work out strategies that you like for autonomous, write the scripts, and give them a 'playbook'.

Well, i'm getting off track. For you to schedule things to happen, you can do something as simple as this if you want, now this is dirty but I think gets you where you want, again, if I were you I'd go ahead and just write the script executor, but, here we go:

Code:
//variable
unsigned int time = 0;

//inside User_Autonomous_Code

time++;
if (time < 10)
{
  //do things that happen until 10 time counts (or until .254 seconds if using frc controller)
  pwm01 = pwm02 = 200; //drive forwards-ish
}
else if (time < 100)
{
   //do things that happen until 100 time counts (or 2.54seconds)
   pwm01 = 100;
   pwm02 = 200;  //spin for a while
}
//etc.
That should do what you want I think... and yes, it is very very true that an encoded tire is always better than a dead-reckoned one.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Segway to offer financing option Jon K. Dean Kamen's Inventions 5 02-06-2006 12:13
Show Avatar option broken devicenull CD Forum Support 0 12-02-2006 23:17
Check All option on Recent Activity Configuration sanddrag CD Forum Support 0 29-01-2006 22:35
The 'nuclear option' has been averted JoeXIII'007 Chit-Chat 19 24-05-2005 20:28
The Chat Option Ragin_Kage Chit-Chat 2 04-03-2002 01:19


All times are GMT -5. The time now is 19:38.

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