528
// Define pin assignments for RGB LEDs #define REDPin RC0 // Red LED pin #define GREENPin RC1 // Green LED pin #define BLUEPin RC2 // Blue LED pin /** * Initialize Timer2 for PWM */ void PWM_Init() { PR2 = 255; // Set period register for PWM period T2CKPS0 = 0; // Set prescaler to 1:1 T2CKPS1 = 0; TMR2ON = 1; // Turn on Timer2 CCP1M3 = 1; // Configure CCP1 module for PWM mode CCP1M2 = 1; }