Subversion Repositories svnkaklik

Rev

Rev 136 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 136 Rev 141
Line 1... Line 1...
1
#include "C:\PIC\camerus\camerus.h"
1
#include ".\camerus.h"
2
 
2
 
3
#use fast_io (C)
3
#use fast_io (C)
4
 
4
 
5
#define LED PIN_C0
5
#define LED PIN_C0
6
#define HREF PIN_C5
6
#define HREF PIN_C5
Line 17... Line 17...
17
   setup_timer_2(T2_DIV_BY_16,62,1);
17
   setup_timer_2(T2_DIV_BY_16,62,1);
18
   setup_ccp1(CCP_PWM); // RC1
18
   setup_ccp1(CCP_PWM); // RC1
19
   setup_ccp2(CCP_PWM); // RC2
19
   setup_ccp2(CCP_PWM); // RC2
20
   setup_comparator(NC_NC_NC_NC);
20
   setup_comparator(NC_NC_NC_NC);
21
   setup_vref(FALSE);
21
   setup_vref(FALSE);
22
   
22
 
23
   set_tris_c(0x11111000); 
23
   set_tris_c(0x11111000);
24
 
24
 
25
   output_high(LED);
25
   output_high(LED);
26
 
26
 
27
   i2c_start();      // Reset
27
   i2c_start();      // Reset
28
   i2c_write(0xC0);
28
   i2c_write(0xC0);
Line 79... Line 79...
79
   {
79
   {
80
      while(!input(HREF));
80
      while(!input(HREF));
81
      set_timer0(0);
81
      set_timer0(0);
82
      while(input(PIX));
82
      while(input(PIX));
83
      set_pwm1_duty(get_timer0());
83
      set_pwm1_duty(get_timer0());
84
      delay_ms(1);     
84
      delay_ms(1);
85
   };
85
   };
86
}
86
}