In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: The program is skipping right over your pin definitions. I think you'll find SX/B a little easier if you'll use the template from the help file; it lays out the kinds of things you will have in your program and in the *best* (my opinion) order to make things easy for you to succeed. Here's my rewrite of your program. [code]' ========================================================================= ' ' File...... CLICKS.SXB ' Purpose... ' Author.... ' E-mail.... ' Started... ' Updated... ' ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Conditional Compilation Symbols ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42 FREQ 4_000_000 ID "CLICKS" ' ------------------------------------------------------------------------- ' I/O Pins ' ------------------------------------------------------------------------- Led7 PIN RC.7 OUTPUT Led6 PIN RC.6 OUTPUT Led5 PIN RC.5 OUTPUT Led4 PIN RC.4 OUTPUT Led1 PIN RC.0 OUTPUT Camera PIN RB.4 OUTPUT Receiver PIN RC.1 INPUT ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- IsOn CON 1 IsOff CON 0 ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- pWidth VAR Byte ' ========================================================================= ' INTERRUPT ' ========================================================================= ' RETURNINT ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Subroutine / Function Declarations ' ------------------------------------------------------------------------- DELAY_MS SUB 1, 2 PIC1 SUB 0 PIC3 SUB 0 CLICKS SUB 0 ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: PLP_A = %00000000 PLP_B = %00010000 PLP_C = %11110011 Main: PULSIN Receiver, 1, pWidth IF pWidth > 200 THEN PIC3 ELSEIF pWidth > 100 THEN PIC1 ENDIF DELAY_MS 1000 GOTO Main ' ------------------------------------------------------------------------- ' Subroutine / Function Code ' ------------------------------------------------------------------------- ' Use: DELAY_MS duration ' -- shell for PAUSE SUB DELAY_MS IF __PARAMCNT = 1 THEN __WPARAM12_MSB = 0 ENDIF PAUSE __WPARAM12 ENDSUB ' ------------------------------------------------------------------------- SUB PIC1 CLICKS ENDSUB ' ------------------------------------------------------------------------- SUB PIC3 CLICKS CLICKS CLICKS ENDSUB ' ------------------------------------------------------------------------- SUB CLICKS Led4 = IsOn Led5 = IsOn Led6 = IsOn Led7 = IsOn Camera = IsOn DELAY_MS 100 Led4 = IsOff Led5 = IsOff Led6 = IsOff Led7 = IsOff Camera = IsOff DELAY_MS 100 ENDSUB ' ------------------------------------------------------------------------- ' User Data ' -------------------------------------------------------------------------[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=286298#m286317 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)