Subversion Repositories svnkaklik

Rev

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

Rev 215 Rev 217
Line 1... Line 1...
1
// **** Objeti cihly vpravo **** RRRR
1
// **** Objeti cihly vpravo **** RRRR
-
 
2
// Verze pouzita na Robot Challenge 
-
 
3
 
2
int8 n,i;
4
int8 n,i;
3
int16 j;
5
int16 j;
4
 
6
 
5
set_adc_channel(RMAX);
7
set_adc_channel(RMAX);
6
 
8
 
Line 133... Line 135...
133
SetServo(CASMIN);   // max. doleva                 L
135
SetServo(CASMIN);   // max. doleva                 L
134
set_pwm1_duty(0);   // vzad
136
set_pwm1_duty(0);   // vzad
135
set_pwm2_duty(0);
137
set_pwm2_duty(0);
136
output_low(MOT_L);
138
output_low(MOT_L);
137
output_high(MOT_R);
139
output_high(MOT_R);
138
while (read_adc()>TRESHOLD); 
140
while (read_adc()>TRESHOLD);
139
odocounter=get_timer1();    // Poznamenej aktualni stav odometrie
141
odocounter=get_timer1();    // Poznamenej aktualni stav odometrie
140
while(get_timer1()<(odocounter+4)); // Popojed definovanou vzdalenost
142
while(get_timer1()<(odocounter+4)); // Popojed definovanou vzdalenost
141
set_pwm1_duty(0);    // reverz (zabrzdi)
143
set_pwm1_duty(0);    // reverz (zabrzdi)
142
set_pwm2_duty(255);
144
set_pwm2_duty(255);
143
output_low(MOT_L);
145
output_low(MOT_L);