Go to Post Good teams get picked, great teams want to do the picking... - Dave McLaughlin [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
  #1   Spotlight this post!  
Unread 20-02-2007, 12:52
Tz0m Tz0m is offline
Registered User
FRC #0333
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: New York
Posts: 17
Tz0m is an unknown quantity at this point
Autonomous calculations

How exactly can I implement my formula to calculate distance into my autonomous code? I want the robot to move forward while the distance is greater than a certain number. If I use a while loop the rc crashes and does nothing. This is the code I have so far:
Quote:
while (autonomous_mode || p3_sw_trig == 1) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

// Start autonomous code

// call camera functions
Servo_Track();
Camera_Handler();
Tracking_Info_Terminal();

if (Get_Tracking_State() == CAMERA_ON_TARGET)
{
pwm13 = pwm14 = 104;
pwm15 = pwm16 = 150;
}
else if (Get_Tracking_State() == SEARCHING)
{
pwm13 = pwm14 = 150;
pwm15 = pwm16 = 104;
}

// End autonomous code

PWM(pwm13,pwm14,pwm15,pwm16);

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
How can I build my code around this?
 


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
Motor Calculations John Gutmann Motors 3 25-06-2006 08:39
Volume/Weight Calculations in Inventor =Martin=Taylor= Inventor 2 08-04-2006 10:21
Distance calculations Max Brin Programming 3 22-02-2006 21:38
Autonomous danielkitchener Rumor Mill 3 03-01-2004 01:08
Seeding Calculations archiver 2000 50 23-06-2002 21:57


All times are GMT -5. The time now is 04:44.

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