Go to Post Unfortunately, not everyone is Andy Baker. If everyone had this mindset, there would be far fewer problems. - Kevin Kolodziej [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 18-02-2006, 07:57
CaseyKasem_1251's Avatar
CaseyKasem_1251 CaseyKasem_1251 is offline
Registered User
AKA: John Casey
FRC #1251 (TechTigers)
Team Role: Student
 
Join Date: Apr 2005
Rookie Year: 2004
Location: Florida
Posts: 21
CaseyKasem_1251 is on a distinguished road
Send a message via AIM to CaseyKasem_1251
Need help with code

ok so i have some autonomous code right now and This code gets the Tilt_servo variable from tracking.c, then goes into a
loop, and waits for a while, then gets the value again and tests it
against the previous value to guaranty that it has not changed. If the
value has not been updated, we assume that the target has been found
and we can then pass the value as the final value. right now this code looks like this
Quote:
void User_Autonomous_Code(void)
{
/* Initialize all PWMs and Relays when entering Autonomous mode, or else it
will be stuck with the last values mapped from the joysticks. Remember,
even when Disabled it is reading inputs from the Operator Interface.
*/
pwm01 = pwm02 = pwm03 = pwm04 = pwm05 = pwm06 = pwm07 = pwm08 = 127;
pwm09 = pwm10 = pwm11 = pwm12 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;
relay3_fwd = relay3_rev = relay4_fwd = relay4_rev = 0;
relay5_fwd = relay5_rev = relay6_fwd = relay6_rev = 0;
relay7_fwd = relay7_rev = relay8_fwd = relay8_rev = 0;

while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

/* Add your own autonomous code here. */

angle = TILT_Servo;
try_again = false
while (try_again == false)
{
first_angle == TILT_Servo;
for (y = 1; y<=1000; y++)
//do nothing-wait
second_angle = TILT_Servo
if (first_angle == second_angle)
{
(TILT_Servo)
}
else
try_again = true;

}

Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}
i keep getting errors at while (try_again == false) and (first_angle == second_angle) any help or constructive criticsm would be most helpful

Thanks
__________________
2008 UCF Regional Champs thanks to 233 and 86
2008 UCF Regional GM Industrial Design Award
2007 Palmetto Regional finalists thanks to 1626 and 1758
2007 Palmetto Regional Motorola Quality Award
2007 UCF Regional Champs thanks to 1270 and 86
2007 UCF Regional GM Industrial Design Award
2006 Palmetto Regional Champs thanks to 11 and 247
2006 UCF Regional Semifinalist thanks to 86 and 710
2005 Palmetto Regional finalist thanks to 25 and 301
2005 Palmetto Regional Xerox Creativity Award
2005 UCF Regional finalists thanks to 845 and 1270
2005 UCF Regional Judges Award
2004 UCF Regional Rookie All-star Award


Last edited by CaseyKasem_1251 : 18-02-2006 at 08: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
Encoder Code Kevin Watson Programming 47 18-02-2008 12:56
Problem with idata_user_routines.o? Adrien Programming 3 12-02-2006 01:33
Trying to import Camera code into program without. Kingofl337 Programming 1 18-02-2005 00:43
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
heres the code. y this not working omega Programming 16 31-03-2004 15:18


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

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