@ DEVICE pic16F628A, INTRC_OSC_NOCLKOUT @ Device MCLR_off @ Device WDT_off @ Device Bod_off 'Robotus.Net 'Kasim 2011 'Rokart 3.1 icin gecerli programdir. 'Cizkon Sensor karti cikislari (1-2-3) b.0, b.1 ve b.2 pinlerine baglidir. '************ CMCON = 7 x var word cizginerede var word '************ output porta.2 output porta.6 output porta.7 output portb.3 input portb.0 input portb.1 input portb.2 '************ sayim: for x = 1 to 2 high porta.2 low portb.6 low portb.7 low porta.6 low porta.7 pause 300 low porta.2 low portb.6 low portb.7 low porta.6 low porta.7 pause 300 next '************ basla: If portb.0=1 and portb.1=1 and portb.2=1 then tamgaz If portb.0=1 and portb.1=0 and portb.2=1 then tamgaz If portb.0=0 and portb.1=1 and portb.2=1 then tamgaz If portb.0=1 and portb.1=1 and portb.2=0 then tamgaz If portb.0=0 and portb.1=1 and portb.2=0 then tamgaz If portb.0=0 and portb.1=0 and portb.2=1 then cizgisag If portb.0=1 and portb.1=0 and portb.2=0 then cizgisol If portb.0=0 and portb.1=0 and portb.2=0 then durum goto basla '----------------------- tamgaz: high portb.3 cizginerede=33 high 6 low 7 high porta.6 low porta.7 goto basla '----------------------- cizgisag: high portb.3 high 6 low 7 low porta.6 low porta.7 pause 2 cizginerede=5 goto basla '----------------------- cizgisol: high portb.3 low 6 low 7 high porta.6 low porta.7 pause 2 cizginerede=7 goto basla '----------------------- cizgisag2: high portb.3 high 6 low 7 low porta.6 high porta.7 cizginerede=5 goto basla '----------------------- cizgisol2: high portb.3 low 6 high 7 high porta.6 low porta.7 cizginerede=7 goto basla '----------------------- durum: if cizginerede=5 then cizgisag2 if cizginerede=7 then cizgisol2 goto basla '-----------------------