Page 202 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 202
Amphibionics 05 3/24/03 8:44 AM Page 181
PROGRAM 5.5
Low servo6
serpentronic.bas
program listing
turn_count = 0 Chapter 5 / Serpentronic: Build Your Own Robotic Snake
num_samples = 40 (continued)
threshold = 25
'------------------------------------------------------------------------------------------------------------------------------
' create randon noises and flash LED's
For temp1 = 1 to 5
High led_left
Low led_right
GoSub randomize
Pause 50
Low led_left
High led_right
GoSub randomize
Pause 50
Next temp1
Low led_right
'------------------------------------------------------------------------------------------------------------------------------
' start main execution
start:
If cal_switch = 1 then
pause 50
release_calibrate:
If cal_switch = 1 then
goto release_calibrate
else
Sound piezo,[120,4,90,2,100,2,110,4]
pause 50
goto ir_cal
endif
181