Program programme; Var l,i:longint; Label L1; begin trisb:=$FC; trisc:=$FF; trisa:=$FF; ADCON1:=$8E; portb:=0; while (true) do begin L1: i:=0; portb:=0;delay_ms(5000); l:=adc_read(0);delay_ms(10); while ((l<512)and (portc.0=0)) do begin portb.0:=1; l:=adc_read(0);delay_ms(100); i:=i+1; if i=50 then goto L1; end; portb:=0; while ((l>512)and (portc.1=0)) do begin portb.1:=1; l:=adc_read(0);delay_ms(100); end; end; end.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)