2444 |
kaklik |
1 |
#include "D:\svnKaklik\programy\C\PIC\test\PIC16F887\blik.h" |
|
|
2 |
|
|
|
3 |
|
|
|
4 |
#define LED PIN_D6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
|
|
5 |
|
|
|
6 |
void main() |
|
|
7 |
{ |
|
|
8 |
|
|
|
9 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
|
|
10 |
setup_adc(ADC_CLOCK_DIV_2); |
|
|
11 |
setup_spi(SPI_SS_DISABLED); |
|
|
12 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
13 |
setup_timer_1(T1_DISABLED); |
|
|
14 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
15 |
setup_ccp1(CCP_OFF); |
|
|
16 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
|
|
17 |
|
|
|
18 |
//Example blinking LED program |
|
|
19 |
while(true){ |
|
|
20 |
output_low(LED); |
|
|
21 |
delay_ms(1000); |
|
|
22 |
output_high(LED); |
|
|
23 |
delay_ms(1000); |
|
|
24 |
} |
|
|
25 |
|
|
|
26 |
} |