I'm wondering if the error
"C:\Documents and Settings\Sergio Alonso\MPLABXProjects\DEMO.X\LEDBLINK1.c:47:Error: syntax error"
Is due to you declaring the "i" variable inside the for statement.
Line 47: for(
int i = 1; i < 250; i++)
A Google for "Scope of a variable declared in for loop" finds this..
>A)Is it possible to declare a variable inside for loop like
> for(int i=100;i>=0;i--);
You can do this in C99 and C++, but not in preceding C standards.
Given the low popularity of C99 amongst compiler vendors I recommend
against using its features.
Maybe your Win7 install was using C99/C++ but your XP install is using a preceding standard?
It's easy to check, move the declaration outside the loop for all your functions
int i;
for(i = 1; i < 250; i++) // Modulate Pulse Width of LED2 increasing in duty cycle
{
LEDPin = ~LEDPin;//Toggle LED Pin On
Delay10TCYx(i);
LEDPin = ~LEDPin;//Toggle LED Pin Off
Delay10TCYx(250 - i);
while (TRIGGER == 1){short_pulse_green();}
}
for(i = 1; i < 250; i++) // Modulate Pulse Width of LED2 decreasing in duty cycle
{
LEDPin = ~LEDPin;//Toggle LED Pin On
Delay10TCYx(250 - i);
LEDPin = ~LEDPin;//Toggle LED Pin Off
Delay10TCYx(i);
while (TRIGGER == 1){short_pulse_green();}
}