' ' PANTILT.BS2 ' Reactive Technologies ' reactivtec@aol.com ' http://members.aol.com/reactivtec ' P.O. Box 2095, Merrimack NH, 03054 ' This is a Parallax Basic Stamp II program that receives the ' output of the Pan/Tilt credit card size infrared remote control. ' The only external hardware required is a Sharp GP1U52X infrared ' receiver module available through Radio Shack and other distributors. ' Connect the output of the GP1U52X to P7 on the Basic Stamp II. 'This program was adaptated from : 'IR.BAS 'by Brad Suppanz, 7-11-94 'Logical Approach Engineering '(805) 491-0951 'suppanz@aol.com bt0 var word 'storage for pulse times bt1 var word bt2 var word bt3 var word bt4 var word bt5 var word bt6 var word bt7 var word bt8 var word d var byte 'current decoded data rcv_data var byte 'previous decoded data rcv_data = 0 main: pulsin 7,0,bt0 'look for initial button press if bt0 < 4000 then main rcv: pulsin 7,1,bt0 'wait for start bit if bt0 < 2000 then rcv 'valid start bit is > 2000 pulsin 7,1,bt0 'ignore first byte pulsin 7,1,bt1 pulsin 7,1,bt2 pulsin 7,1,bt3 pulsin 7,1,bt4 pulsin 7,1,bt5 pulsin 7,1,bt6 pulsin 7,1,bt7 pulsin 7,1,bt0 'read 2nd byte pulsin 7,1,bt1 pulsin 7,1,bt2 pulsin 7,1,bt3 pulsin 7,1,bt4 pulsin 7,1,bt5 pulsin 7,1,bt6 pulsin 7,1,bt7 d.bit0=bt0/512 'convert bit stream d.bit1=bt1/512 d.bit2=bt2/512 d.bit3=bt3/512 d.bit4=bt4/512 d.bit5=bt5/512 d.bit6=bt6/512 d.bit7=bt7/512 if rcv_data = d then process 'we double reveive for verification rcv_data = d goto rcv process: if d=$51 then wide if d=$52 then tele if d=$a1 then left if d=$a2 then right if d=$a3 then up if d=$a4 then down if d=$a9 then auto if d=$59 then start goto rcv wide: debug "W" goto main tele: debug "T" goto main left: debug "L" goto main right: debug "R" goto main up: debug "U" goto main down: debug "D" goto main auto: debug "A" goto main start: debug "S" goto main