Datasheet
Chapter 2. First Program - Blink an LED
12
A dialog will open allowing you to provide a name for the project. Be certain the filename you choose ends
in .c. At this point it is worth considering your conventions for naming source files. It is the C tradition
to name the mainline of a C program main.c. However, there will be a lot of main.c's, so it could be
preferable to name the mainline source the same as the name of the project. If you really like to type, you
may prefer to combine both, as shown below.
Figure 2.11. Name the new file
One problem with having very long names is that they take space in the project pane. If you have a lower
resolution screen, you may prefer to leave as much space as possible for the rightmost pane, making your
left panes smaller. it can be quite annoying if most of the filenames are hidden.
#include <xc.h>
int main()
{
TRISDbits.TRISD1 = 0;
while( 1 )
{
LATDbits.LATD1 = 0;
LATDbits.LATD1 = 1;
}
}
Refer to Table F.1, “Include Files” for a list of include file locations known to the compiler.