'>TinyTim DLB 20-5-94 '0-smf 1-smb 2-pmf 3-pmb 4-bump 5-sound 6-sldr 7-pldr 'bump sensors -: sf-4k7 pf-lOk rear not connected symbol bumpscale =123 symbol lightscale =100 symbol bright =50 'black is 255, incandescent is 0 dirs =%1111 'motor pins Outputs start: gosub tune :random w5 :b8 =b10&%11 pot 4,bumpscale,b2 :if b2=0 then avoidLR if b2>200 then avoidR :if b2>100 then avoidL pot 6,lightscale,b2 :pot 7,lightscale,b3 debug #b3,#b2,cr if b2>b3 then darkright darkleft: b4 =b3-b2 :if b4<20 then explore if b25 then newmove :goto start newmove: pins =b10&%1010 :b9=0 :goto start '&%1010=>mtrs only fd avoidL: pins =%0101 :gosub tune5 :pins =%0001 :gosub tune3 :goto start avoidR: pins =%0101 :gosub tune5 :pins =%0100 :gosub tune3 :goto start avoidLR: pins =%0101 :gosub tune4 :pins =%0001 :gosub tune4 :goto start :goto start turnleft: pins =%0110 :gosub tune2 :goto start curveleft: pins =%0010 :gosub tunel :goto start turnright: pins =%1001 :gosub tune2 :goto start curveright: pins =%1000 :gosub tunel :goto start tune: for b2 =200 to 127 : sound 5,(b2,4) : next b2 : return tunel: sound 5,(100,10,0,10) :return tune2: sound 5,(126,3,0,3) :return tuneS: sound 5,(227,10) :return tune4: sound 5,(180,b8,190,b8,200,b8) :return tune5: for b2 =0 to 50 : sound 5,(227,b8) : next b2 : return