In SX Microcontrollers, SX/B Compiler and SX-Key Tool, brianbr wrote: [quote="Jon Williams (Parallax)"]When defining subs that could have multiple parameters, you need to do it like this (note the comma): GO_FORWARD SUB 0, 1 Then check and pick-up any parameters before doing anything else in your sub -- otherwise the internal variables that carry parameters (__PARAMx) could get clobbered. GO_FORWARD: IF __PARAMCNT = 1 THEN temp1 = __PARAM1 ELSE temp1 = 1 ENDIF servo1 = 75 servo2 = 200 IF temp1 > 0 THEN PAUSE temp1 * 250 ENDIF RETURN[/quote] Thanks Jon. This helps a lot. I am on the road in NJ with just my PowerBook. But to my recollection the example code shows some subroutines fpr DELAY and DELAYUS that shows [code] DELAY SUB 1 2 [/code] without the comma. (or I misread it! ... mea culpa!) Also thanks for the routines you posted I am going to add them to the serial string handling routines as part of a 'standard include' file I am building. When I get back early next week (my #1 son is gettin married tomorrow) look for some SX48 Robot code coming forth with IR sensing collison avoidance. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=88882#m89004 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)