23 #include <p24FJ128GB106.h>
24 #include "GenericTypeDefs.h"
28 #include "outcompare.h"
29 #include "GenericTypeDefs.h"
34 #define PWM_CONV_FACTOR 8
48 void LEDport(
unsigned char lednum,
char state)
98 void RLYport(
unsigned char rlynum,
char state)
103 if(state){
RLY1 = 0;}
107 if(state){
RLY2 = 0;}
111 if(state){
RLY3 = 0;}
115 if(state){
RLY4 = 0;}
132 void OCport(
unsigned char ocnum,
char state)
167 void buzzer(
unsigned int period_uS,
unsigned int duty_div)
170 unsigned int fixed_period = 0;
172 if(period_uS < 8000){
179 if(duty_div && fixed_period){
183 OpenOC2(OC_SYSCLK_SRC | OC_CONTINUE_PULSE, OC_SYNC_TRIG_IN_CURR_OC, fixed_period, duty);
202 OpenOC1(OC_SYSCLK_SRC | OC_CONTINUE_PULSE, OC_SYNC_TRIG_IN_CURR_OC, 3200, value);