Subversion Repositories svnkaklik

Rev

Rev 471 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 471 Rev 659
1
#include "blik.h"
1
#include "blik.h"
2
 
2
 
3
 
3
 
4
void main()
4
void main()
5
{
5
{
6
 
6
 
7
int i;
7
int i;
8
 
8
 
9
   setup_adc_ports(NO_ANALOGS|VSS_VDD);   // parametry
9
   setup_adc_ports(NO_ANALOGS|VSS_VDD);   // parametry
10
   setup_adc(ADC_OFF);
10
   setup_adc(ADC_OFF);
11
   setup_spi(FALSE);
11
   setup_spi(FALSE);
12
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
12
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
13
   setup_timer_1(T1_DISABLED);
13
   setup_timer_1(T1_DISABLED);
14
   setup_timer_2(T2_DISABLED,0,1);
14
   setup_timer_2(T2_DISABLED,0,1);
15
   setup_comparator(NC_NC_NC_NC);
15
   setup_comparator(NC_NC_NC_NC);
16
   setup_vref(FALSE);
16
   setup_vref(FALSE);
17
   setup_oscillator(False);
17
   setup_oscillator(False);
18
 
18
 
19
   while(true) // nekonecny cyklus
19
   while(true) // nekonecny cyklus
20
   {
20
   {
21
      output_high(PIN_B0);    // nastav B0 na 1
21
      output_high(PIN_B0);    // nastav B0 na 1
22
      Delay_ms(50);           // pockej 50ms
22
      Delay_ms(50);           // pockej 50ms
23
      output_high(PIN_B1);    // nastav B0 na 1
23
      output_high(PIN_B1);    // nastav B0 na 1
24
      Delay_ms(50);           // pockej 50ms
24
      Delay_ms(50);           // pockej 50ms
25
      output_high(PIN_B2);    // nastav B0 na 1
25
      output_high(PIN_B2);    // nastav B0 na 1
26
 
26
 
27
      for(i=0;i<=100;i++)
27
      for(i=0;i<=100;i++)
28
      {
28
      {
29
     
29
     
30
        Output_high(PIN_A2);
30
        Output_high(PIN_A2);
31
        Delay_ms(1);
31
        Delay_ms(1);
32
        Output_low(PIN_A2);
32
        Output_low(PIN_A2);
33
        Delay_ms(1);
33
        Delay_ms(1);
34
      }
34
      }
35
 
35
 
36
      output_low(PIN_B0);     //nastav B0 na 0
36
      output_low(PIN_B0);     //nastav B0 na 0
37
      Delay_ms(50);           // pockej 50ms
37
      Delay_ms(50);           // pockej 50ms
38
      output_low(PIN_B1);     //nastav B0 na 0
38
      output_low(PIN_B1);     //nastav B0 na 0
39
      Delay_ms(50);           // pockej 50ms
39
      Delay_ms(50);           // pockej 50ms
40
      output_low(PIN_B2);     //nastav B0 na 0
40
      output_low(PIN_B2);     //nastav B0 na 0
41
      Delay_ms(50);           // pockej 50ms
41
      Delay_ms(50);           // pockej 50ms
42
   }                          // opakuj cyklus
42
   }                          // opakuj cyklus
43
 
43
 
44
}
44
}