see when i read your post it popped into my head i wrote a counter and threw in some arbitrary numbers im just waiting to test it now, but thanks for the help, heres what i wrote.
Code:
if (rc_dig_in17) {
{
pwm01=200; /*Go forward for 2000*/
pwm02=200;
for(i = 0; i < 2000; ++ i);
pwm01=127; /*stop after*/
pwm02=127;
/*------------------------------------------------------------------------------*/
pwm01=127; /*Go right for 200*/
pwm02=200;
for(i = 0; i < 200; ++ i);
pwm01=127; /*stop after*/
pwm02=127;
/*-----------------------------------------------------------------------------*/
pwm01=200; /*Go forward for 200*/
pwm02=200;
for(i = 0; i < 2000; ++ i);
pwm01=127; /*stop after*/
pwm02=127;
}
}
/**********************************************DEADRECB*************************/
if (rc_dig_in16) {
{
pwm01=200; /*Go forward for 2000*/
pwm02=200;
for(i = 0; i < 2000; ++ i);
pwm01=127; /*stop after*/
pwm02=127;
/*------------------------------------------------------------------------------*/
pwm01=200; /*Go left for 200*/
pwm02=127;
for(i = 0; i < 200; ++ i);
pwm01=127; /*stop after*/
pwm02=127;
/*-----------------------------------------------------------------------------*/
pwm01=200; /*Go forward for 200*/
pwm02=200;
for(i = 0; i < 2000; ++ i);
pwm01=127; /*stop after*/
pwm02=127;
}
}
__________________
If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.
Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy
Photonics, It's Your Future