'------------------------------------------------------ ' Name : ircal-serpent.bas ' Compiler : PicBasic Pro - MicroEngineering Labs ' Notes : Infrared sensor calibration program '------------------------------------------------------ ' PortA set as outputs trisa = %00000000 ' PortB set as outputs. pins 0-1 inputs trisb = %00000011 '------------------------------------------------------ ' initialize variables led_left VAR portA.2 led_right VAR portA.3 ir_input VAR portB.1 low led_left low led_right ir_cal: If ir_input = 0 then high led_left high led_right endif low led_left low led_right goto ir_cal end