In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Okay, I needed a mental distraction so I wrote the program I described above. It's not for beginners, but not terribly difficult once you get the hang of SX/B. This version has an eight-byte serial buffer. Note that with the ISR you should probably run it at 20 MHz. In this program the serial data is buffered, and each time an "a" or "A" is received the Led1 output is turned on and a timer [re]set to one second. Note that if the one-second timer is about half-way done and you send another "a" the timer will be reset to one second; if you want to stack the output such that the LED stays on for one second for every "a" or "A" received you'll need to adjust the code. If you call RX_BYTE when there is nothing in the serial buffer it will "block" just like SERIN, so be careful with this; the reason for the rxReady flag is to let you know if something is there or not. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=264135#m264274 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)