'******************************************************** ' Insectronics: build your own six-legged walking robot ' infrared-cal.bas ' Routine to calibrate the infrared sensor board ' PicBasic Pro Compiler '******************************************************** trisa = %11111111 ' set porta to inputs trisb = %00001100 ' set portb pins 2 & 3 to inputs start: low portb.0 If portb.3 = 0 then ' Check right i.r. module output for logic 0 high portb.0 ' turn on right light emitting diode else low portb.0 endif low portb.1 If portb.2 = 0 then ' Check left i.r. module output for logic 0 high portb.1 ' turn on left light emitting diode else low portb.1 endif goto start