In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote: Are you sure you don't want to use PULSIN? If I remember correctly, a Sony IRCS start bit is 2.4 milliseconds wide. You could wait for the start bit like this: Get_IR_Byte: DO PULSIN IrPin, 0, bitWidth LOOP WHILE bitWidth < 220 This works because the default resolution of 10 uS means a 2.4 millisecon pulse from the IR receiver would put a value of 240 in the variable called bitWidth. You could receive the next eight bits like this: Get_Bits: temp1 = 0 FOR idx = 1 TO 8 temp1 = temp1 >> 1 PULSIN IrPin, 0, bitWidth IF bitWidth > 100 THEN temp1.7 = 1 ENDIF NEXT RETURN temp1 ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=97532#m97544 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)