In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Ray, If you look at Jon's code, you'll see that there are a series of things that the DMX receiver has to do sequentially in order to handle DMX data. It starts with state 0, which causes the program to basically loop around and around checking to see if a DMX break has occurred. If it hasn't, the code loops back to where the state is checked which, determinging it's still in state 0, jumps to see if a DMX break has occurred, etc. etc. At some point (presumably), a DMX break will occur. The code will handle that break and then set the state variable to "1". Now the code check to see if the conditions have been met to handle state 1. IF not, it goes back to the state checking code, sees it's still in state 1, and then jumps to the code that handles state 1. This repeats until state 1 occurs and is handled, at which point the state is set to 2. You can probably see where this is going. The code is either looking to see what state it is in and jumping to the appropriate handler, or the handler for a state is executing. If the handler executes and the state's work doesn't happen, then the code just goes back to see what state it is in. If the state's code does happen, then the state counter is set to the next state, lather, rinse, repeat. Thanks, PeterM ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=242730#m243281 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)