Max
You can try something like this to set the pwm value to 127 after 30 loops:
Code:
void pulse(void)
{
static int loop_count = 0;
if(loop_count < 30)
{
pwm06 = 254;
}
else
{
pwm06 = 127;
}
loop_count++;
}
Then, you would want to call this in your main loop. Note that this method never resets loop_count, so this would run for 30 loops at 254 and then stop.