/roboti/istrobot/camerus/SW/876/camerus.PJT |
---|
10,7 → 10,7 |
LinkerScript= |
[Target Data] |
FileList=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.c |
FileList=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\876\camerus.c |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
31,12 → 31,11 |
0=0000 camerus.c 0 0 796 451 3 0 |
[Opened Files] |
1=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.c |
2=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.lst |
3=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.h |
4=C:\Program Files\PICC\devices\16F876A.h |
1=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\876\camerus.c |
2=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\876\camerus.h |
3=C:\Program Files\PICC\devices\16F876A.h |
4= |
5= |
6= |
[Units] |
Count=1 |
1=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\SW\876\camerus.c (main) |
1=C:\dokumenty\svn\Kaklik\roboti\istrobot\camerus\876\camerus.c (main) |
/roboti/istrobot/camerus/SW/876/camerus.c |
---|
1,11 → 1,10 |
#include ".\camerus.h" |
#USE FAST_IO (C) |
#use fast_io (C) |
#define LED PIN_C0 |
#define HREF PIN_C5 |
#define PIX PIN_C6 |
#define SERVO PIN_B7 |
#define LED PIN_C0 |
#define HREF PIN_C5 |
#define PIX PIN_C6 |
void main() |
{ |
15,13 → 14,13 |
setup_adc(ADC_CLOCK_INTERNAL); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_timer_2(T2_DIV_BY_16,255,1); |
setup_timer_2(T2_DIV_BY_16,62,1); |
setup_ccp1(CCP_PWM); // RC1 |
setup_ccp2(CCP_PWM); // RC2 |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
set_tris_c(0b11111000); |
set_tris_c(0x11111000); |
output_high(LED); |
80,21 → 79,8 |
{ |
while(!input(HREF)); |
set_timer0(0); |
while(input(HREF)) |
{ |
if(!input(PIX)) |
{ |
cas=get_timer0(); |
break; |
} |
}; |
output_high(SERVO); |
delay_us(1000); |
delay_us(cas); |
delay_us(cas); |
delay_us(cas); |
output_LOW(SERVO); |
set_pwm1_duty(cas); |
set_pwm2_duty(255-cas); |
while(input(PIX)); |
set_pwm1_duty(get_timer0()); |
delay_ms(1); |
}; |
} |