View Single Post
  #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.