Page 355 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 355
Amphibionics 07 3/24/03 9:13 AM Page 334
PROGRAM 7.11
encode-test.bas
SOUND piezo,[80,5,110,5,50,10,120,2]
program listing If switch = 0 then Amphibionics
(continued) while switch = 0
wend
endif
goto start
PROGRAM 7.12 :100000003F288F00220884002009282084138F08AD
encode-test.hex file :1000100003193A28F03091000E0880389000F03033
listing :1000200091030319910003198F0303193A28182823
:100030002B2003010C1820088E1F20088E0803199E
:100040000301900F252880060C28262800000F2881
:10005000841780053A280D080C0403198C0A803097
:100060000C1A8D060C198D068C188D060D0D8C0D35
:100070008D0D3A288313031383126400080083163E
:100080008501013086008312061283160612831240
:1000900006138316061383128612831686128312A2
:1000A000861083168610831206118316061183129A
:1000B00086118316861105308312A2000830A00035
:1000C00073308E000A30012032308E000A30012059
:1000D0006400061883280530A2000830A0005030C4
:1000E0008E00053001206E308E0005300120323048
:1000F0008E000A30012078308E000230012064002A
:08010000061883287F286828F7
:02400E00F53F7C
:00000001FF
Room Mapping Using the Shaft Encoder
and Ultrasonic Range Finder
The robot now has the ability to keep track of how far the left
wheel has traveled using the incremental shaft encoder. This will
be necessary when the robot is mapping an area before it starts to
move. In previous programs where the robot used the sonar
ranger, it avoided obstacles in a reactionary way because it did not
have an internal representation of the outside world. It wandered
334

