CaseyKasem_1251
18-02-2006, 07:57
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 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
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 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