The code below works but i need just a few more loops in the code in order to get it to go exactly where i need it to any one know how i can make it start a new count after it gets past 254 so it doesnt loop, and i can add a few more steps to it, or does some one have a better way of doing this ? I got this way to work it just needs to run for a little bit longer.

```
void User_Autonomous_Code(void)
{
int count;
count = 1;
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! */
/*40ticks = 1 sec 20ticks = .5 secs 10ticks=.25 secs */ //increse counter by 1 /* DO NOT DELETE, or you will get no PWM outputs! *//*40ticks = 1 sec 20ticks = .5 secs 10ticks=.25 secs */
if ( count >= 124 ) {
}
if (count > 0 && count < 34 )
{
pwm05 = 60;
}
if (count > 35 )
{
pwm05 = 127;
}
if (count > 0 && count < 30 )
{
pwm04 = 0;
}
if (count > 32 )
{
pwm04 = 127;
}
if (count > 35 && count < 90 )
{
pwm01 = 190;
}
if (count > 35 && count < 90 )
{
pwm02 = 190;
}
if (count > 92 && count <= 122)
{
pwm01 = 190;
}
if (count > 92 && count <= 122)
{
pwm02 = 53;
}
if (count > 130 && count < 160 )
{
pwm01 = 190;
}
if (count > 130 && count < 160 )
{
pwm02 = 190;
}
if (count > 163 && count <= 183)
{
pwm01 = 190;
}
if (count > 163 && count <= 183)
{
pwm02 = 53;
}
if (count > 223 && count < 250 )
{
pwm01 = 190;
}
if (count > 223 && count < 250 )
{
pwm02 = 190;
}
if (count > 255 && count <= 275)
{
pwm01 = 190;
}
if (count > 255 && count <= 275)
{
pwm02 = 53;
}
++count;
Putdata(&txdata);
}
}
}
```

any help would be greatly appreciated.