Page 342 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 342
Amphibionics 07 3/24/03 9:13 AM Page 321
PROGRAM 7.9
if control = "A" then
remote-sonar.bas
program listing
gosub sr_sonar Chapter 7 / Turtletron: Build Your Own Robotic Turtle
if dist_inch < 8 then start (continued)
gosub forward
endif
if control = "B" then
gosub backwards
endif
if control = "C" then
gosub turn_left
endif
if control = "D" then
gosub turn_right
endif
if control = "E" then
sound piezo,[115,10,50,10]
endif
if control = "F" then
low enable_left
low forward_left
low reverse_left
low enable_right
low forward_right
low reverse_right
endif
goto start
'------------------------------------------------------------------------------------------------------------------------------
' movement subroutines
forward:
321