'>TinyTim DLB 20-5-94, 29-7-96 '0-smf 1=smb 2=pmf 3=pmb 4=bump 5=sound 6=sldr 7=pldr 'bump sensors -: sf=4k7 pf=10k sr=22k pr=47k 'w0 b1 b0 'wl b3 POT Leye b2 POT bump, Reye, FOR counter 'w2 b5 eye difference b4 random workplace for avoid 'w3 b7 b6 SYMBOL movemask 'w4 b9 explore counter b8 frustrated counter 'w5 RANDOM bll b10 read for random move 'W6 GOSUB read 255,b2 :debug b2 'b2 = first byte used, ie, 2--> 0 and 1 free 'b2 =0 !! symbol bumpscale =64 symbol lightscale =100 symbo1 bright =50 'black is 255, incandescent is 0 symbol diffeyes =20 'minimum difference between eyes for action symbol explorecount =5 'explore loops before new move symbol movemask =b6 '%1010->motors forward only symbol frustrated =50 '150 then avoidLR :if b2>70 then avoidR :if b2>40 then avoidL movemask =%101O :goto newmove 'to avoid rear eyes: pot 6,lightscale,b2 :pot 7,lightscale,b3 debug #b3,#b2,cr 'cmnd only takes 2 bytes! if b2>b3 then darkright darkleft: b5 =b3-b2 :if b5explorecount then newmove :goto start newmove : pins =b10movemask :b9=0 :goto start avoidL: pins =%0101 :gosub tune3 :pins =%0001 :nap 4 :goto start avoidR: pins =%0101 :gosub tune3 :pins =%0100 :nap 4 :goto start avoidLR: pins =%0101 :gosub tune3 :pins =%0001 :nap 4 :goto start turnleft: pins =%0110 :gosub tune2 :goto start turnright: pins =%1001 :gosub tune2 :goto start curveleft: pins =%0010 :gosub tunel :goto start curveright: pins =%1000 :gosub tunel :goto start tune: for b2= 100 to 110 :sound 5,(b2,1) :next b2 :return tunel: sound 5,(100,5,0,5) :return tune2: sound 5,(126,2,0,2) :return tune3: for b2=0 to 50 :sound 5 ,(227,b4) :next b2 :return 'if b4 is zero what happens? how long is sound? does it explain stopping while chirping? 'tune5: sound 5,(227,10) :return 'tune4: sound 5,(180,b4) :return