In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Professorwiz wrote: Hi all, I'm trying to get into the SX again after a short time away. I haven't used the subroutine function and was trying to use it. Could someone tell me what I'm missing.. I'm sure it's a simple.. It's giving me an invalid parameter on the subroutine CLICKS, on line High LED4. Is this because I should be passing a paramenter there? I don't get it. Thanks, Russ ' ========================================================================= ' ' File...... pwidth2 ' Purpose... Trigger a camera shutter ' Author.... Russell Wizinsky ' E-mail.... [url=Russw@professorwiz.com]Russw@professorwiz.com[/url] ' Started...8/1/08 ' Updated...8/18/08 ' ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' The purpose of the program is to trigger a the shutter of a camera ' dependent on the movement of a remote control for Airplanes / Helis ' Down position will be camera off / standby ' Midstick will be single shot ' Top Stick will be 3 round bursts ' After all camera shots there will be a 1 second delay ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 PROGRAM Start ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- led1 pin rc.0 output led4 pin rc.4 output led5 pin rc.5 output led6 pin rc.6 output led7 pin rc.7 output Camera pin rb.4 output Receiver pin rc.1 input ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- '------------------------------------------------------------------------- ' Subroutines '------------------------------------------------------------------------ PIC3 SUB CLICKS SUB PIC1 SUB PIC3: CLICKS CLICKS CLICKS ENDSUB PIC1: CLICKS ENDSUB CLICKS: HIGH led4 HIGH led5 HIGH led6 HIGH led7 HIGH camera PAUSE 100 LOW led4 LOW led5 LOW led6 LOW led7 LOW Camera PAUSE 100 ENDSUB ' Variables ' ------------------------------------------------------------------------- pWidth var byte ' ------------------------------------------------------------------------- ' INTERRUPT ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------ Start: PULSIN receiver, 1, pWidth IF pWidth > 200 then PIC3 pause 1000 goto start ENDIF IF pWidth >100 then PIC1 pause 1000 goto start ENDIF pause 1000 goto start ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=286298 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)