Page 191 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 191
Amphibionics 05 3/24/03 8:44 AM Page 170
FIGURE 5.58
Adjusting the infrared
sensor board. Amphibionics
the LEDs flicker and then turn off. Move your hand toward the sen-
sor. With your hand at a distance of approximately 7 inches from
the sensor, the LEDs should start to flicker. With your hand at a
distance between 5 and 6 inches, the LEDs should be turned on
solid.
'------------------------------------------------------------------------------------------------------------------------------
PROGRAM 5.3
ircal-serpent.bas ' Name : ircal-serpent.bas
program listing ' 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
170