|
Re: quick c question
[above]
int counter = 0;
int tracker = 0;
counter ++
[below]
if (counter<60)
{
arm = 0;
}
tracker = counter;
else if (counter<tracker+32)
{
arm = 127;
l_motor=r_motor=191;
}
tracker = counter;
else if(counter < tracker + 55)
{
l_motor=r_motor=127;
arm = 255;
}
this is for dead reckoning without any kind of sensor using a clock of sorts.
i know this seems kind of strange, the reason I'm doing it this way is so I can easily make slight changes without having to change every value
thanks,
Dan
|