In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote: Mike, As you figured out, your code is redundant (always sending four bytes) so you could create a subroutine like this: Update_Display: temp1 = __PARAM1 temp2 = __PARAM2 temp3 = __PARAM3 temp4 = __PARAM4 I2CSTART SDA, TopSlave I2CSEND SDA, $60 I2CSEND SDA, temp1 I2CSEND SDA, temp2 I2CSEND SDA, temp3 I2CSEND SDA, temp4 I2CSTOP RETURN Of course, you'd have to define this at the top of the program like this: Update_Display SUB 4 ... and then -- here's the cool part -- you can call it from your program like this: Update_Display $00, $01, $00, $01 This will be easier to code, and save a lot of space as you're expanding fewer I2CSEND instructions. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=107388#m107390 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)