/programy/C/PIC/mereni/TDC/Pulzni_generator/main.c |
2,13 → 2,13 |
|
#use fast_io (D) |
|
#define LED PIN_E1 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
|
#define START PIN_D4 |
#define STOP1 PIN_D5 |
#define STOP2 PIN_D7 |
|
#define FIRE_DETECT PIN_D6 |
|
|
void main() |
{ |
|
25,16 → 25,17 |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
|
//Example blinking LED program |
while(true){ |
output_low(LED); |
delay_ms(1000); |
output_high(LED); |
delay_ms(1000); |
} |
SET_TRIS_D( 0b00000100 ); |
|
while(true) |
{ |
delay_ms(50); |
output_low(START); |
output_low(STOP1); |
output_low(STOP2); |
|
// Mode 1 |
|
/* |
delay_ms(50); |
output_low(START); |
output_low(STOP1); |
49,11 → 50,12 |
output_low(STOP2); |
output_low(START); |
|
|
*/ |
// mode 2 |
|
output_high(STOP2); // Merime jenom jednim kanalem (druhy musi byt v H) |
|
while(!input(FIRE_DETECT)); |
|
output_high(START); |
output_low(START); |
delay_us(150); |
68,5 → 70,5 |
|
output_high(STOP1); |
output_low(STOP1); |
delay_us(1); |
} |
} |