In SX Microcontrollers, SX/B Compiler and SX-Key Tool, keeloq wrote: ANYBODY CAN EXPLAIN THIS SXB CODE FOR ME................. ' Use: Tx_SIRCS irWord ' -- transmit 12-bit (device + command) SIRCS code ' -- sends three frames SUB Tx_SIRCS tmpW2 = __WPARAM12 ' capture code FOR tmpB1 = 1 TO 3 ' send three frames ' start bit IrAnode = IR_ENABLE ' activate IR LED Delay MS_24 ' wait 2.4 ms IrAnode = IR_DISABLE ' deactivate IR LED Delay MS_06 ' wait 0.6 ms ' clock the bits, LSB first tmpW3 = tmpW2 ' make copy of ir word FOR tmpB2 = 1 TO 12 ' send 12 bits IrAnode = IR_ENABLE ' activate IR LED IF tmpW3.0 = 1 THEN ' if 1 Delay MS_12 ' wait 1.2 ms ELSE ' otherwise Delay MS_06 ' wait 0.6 ms ENDIF IrAnode = IR_DISABLE ' deactivate IR LED Delay MS_06 tmpW3 = tmpW3 >> 1 ' get next bit NEXT Delay_MS 33 ' pad for ~45 frame time NEXT ENDSUB [red] [/red] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=194489#m194646 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)