When I run this code I get the following error:
main.c:19: error: 'for' loop initial declaration used outside C99 mode
I tried initialising the 'delay' variable outside the loop. Still get that error.
When I program PIC's, not dsPIC's and I write such a loop to get a delay I don't get that error. I only get it when I'm using the dsPIC programmer. Any ideea why? Thanks for reading.
Well thus far I have been using it like that and got no errors(I've seen it in a tutorial). I even tested with a program that I wrote for PIC18f2550 and it worked fine. I'm guessing it's included in stdio or stdlib.
In header.h I have: "#define __XTAL_FREQ 8000000" if that's what you mean by defining a frequency.
The dspPic range use the C30 compiler.... I don't think it uses that syntax...
The __delay_ms() was defined in the pic.h on the HTC compiler.. If you loose the for loop and just write the delay instruction... What does the compiler say!!
The dspPic range use the C30 compiler.... I don't think it uses that syntax...
The __delay_ms() was defined in the pic.h on the HTC compiler.. If you loose the for loop and just write the delay instruction... What does the compiler say!!