In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: ThresholdStart CON 250 ' 1000 (will use resolution setting of 4 in SX/B) ThresholdPulse CON 100' 500 (BS2 pulsin is in 2uSec, SX/B is in 10uSec) ThresholdEdge CON 150' 300 (will user resolution setting of 2 in SX/B) GetCode: remoteCode = 0 DO RCTIME IrDet, 1, IrPulse, 4 LOOP UNTIL irPulse > ThresholdStart PULSIN IrDet, 0, irPulse IF irPulse > ThresholdPulse THEN remoteCode.BIT0 = 1 RCTIME IrDet, 0, irPulse, 2 IF irPulse > ThresholdEdge THEN remoteCode.BIT1 = 1 RCTIME IrDet, 0, irPulse, 2 IF irPulse > ThresholdEdge THEN remoteCode.BIT2 = 1 RCTIME IrDet, 0, irPulse, 2 IF irPulse > ThresholdEdge THEN remoteCode.BIT3 = 1 RCTIME IrDet, 0, irPulse, 2 IF irPulse > ThresholdEdge THEN remoteCode.BIT4 = 1 RCTIME IrDet, 0, irPulse, 2 IF irPulse > ThresholdEdge THEN remoteCode.BIT5 = 1 RCTIME IrDet, 0, irPulse, 2 IF irPulse > ThresholdEdge THEN remoteCode.BIT6 = 1 Try this... I've only posted the relavent code. Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=97532#m97571 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)