one possible problem is that you never set variable t, and you never have it do anything after the 114 loops, like neutralizing them.
Try this:
Code:
static unsigned int t=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. */
t++;
if (t <114) //edit(added): runs Forward for 113*26.2ms = 2.9606s
{
pwm01=160;
pwm02=160;
}
else
{
pwm01 = 127;
pwm02 = 127;
}
...etc...