Data Sheet
10. Now we need to create the C source file. Locate the “Projects” pane. If the “Projects” pane is not
visible, you can open it by opening the “Window” menu and selecting “Projects”. Left-click the “+”
sign next to “Source Files” to expand it and verify that your project has no source files yet. Then right-
click on “Source Files”, select “New”, and then select “C Source File…”.
11. Choose a file name like “main” and then click Finish.This should create a new file named “main.c”
and open it for editing.
12. Copy and paste the following code into main.c:
#include <xc.h>
#define _XTAL_FREQ 48000000
#define LED_GREEN(v) { TRISB7 = !(v); }
#define LED_YELLOW(v) { TRISB6 = !(v); }
#define LED_RED(v) { TRISC6 = !(v); }
void main()
{
// Set up the LEDs
LATB7 = 1;
LATB6 = 1;
Pololu P-Star 25K50 Micro User’s Guide © 2001–2017 Pololu Corporation
5. Getting started Page 18 of 38