In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: As Rodney points out, once you get the knack for SX/B things will really start to flow -- and it really is a lot of fun. On interrupts: you want to keep them as short as possible and don't do any "big" things (like delays) in them. Remember, the interrupt is disrupting your main program and you want to minimize this disruption. It does take a new way to look at things but, again, once you get the hang of it you'll have a blast. On my PAUSE comment; what I want to clarify is that you can have as many delays in a program as required (just not in the INTERRUPT section); what I strongly suggest, however, is that the PAUSE keyword appear only once in your listing and be wrapped up in a subroutine that you can call (I always call it DELAY_MS). What this does is put all the code for PAUSE in one place and only once; this saves your code space. If you look at the list file (use Ctrl-L in the IDE) for the program that was giving you trouble you can actually see all of those PAUSE statements compiled in place and taking up a lot of space in the listing. Finally, keep in mind that SX/B is a living, breathing entity (Bean is the wacky scientist in the lab coat) so programs that I wrote a couple years ago I would (and do) write differently today. SX/B has matured and, frankly, I've become a better programmer. I am constantly refining my programs as I learn new tricks from gurus like Bean, PJV, PJ Monty, Guenther Daubach, Peter Verkaik, and others -- you get the idea, there's a bunch of smart cats here so take advantage of their brains. I do! ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=291162#m291309 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)