'IRMTEST.BS2 12C508A-Based IR Decoder test program for the Stamp II '(C) 2000 Michael A Owings. All Rights Reserved 'Note that in real life, the serin command should include a timeout CmdData con 0 'Data/Trig to/from 12C508 Attn con 1 'Atn from 12C508 baud con 396 'baud rate. 8-n-1 2400 non-inverted charn var byte 'input variable. main: input Attn high CmdData 'Set trig high debug "Starting...",cr 'Greetings cwait: if in1 = 0 then cwait 'Wait for atn to go high output CmdData 'Make CmdData an output low CmdData 'Trig low pause 45 'wait a bit high CmdData 'Trig high -- we're ready! serin CmdData, baud, [charn] 'Read data debug "Got cmd: ", dec charn, cr 'Print it goto cwait 'Do it again