In SX Microcontrollers, SX/B Compiler and SX-Key Tool, basicstampede wrote: Hello. I want to monitor two pins. When the two pins are dissimilar, then I want to increase a counter by 1. Here is my code. It won't compile. The error message says "unknown command LET". What is this? ' ========================================================================= ' ' File...... ' Purpose... ' Author.... ' E-mail.... ' Started... ' Updated... ' ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Conditional Compilation Symbols ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42 FREQ 4_000_000 ' ------------------------------------------------------------------------- ' I/O Pins ' ------------------------------------------------------------------------- Pin1 PIN RA.0 INPUT Pin2 PIN RA.2 INPUT ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- a VAR bit b VAR bit cc VAR bit ' ========================================================================= ' INTERRUPT ' ========================================================================= 'ISR_Start: ' ISR code here 'ISR_Exit: 'RETURNINT ' {cycles} ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Subroutine / Function Declarations ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: a = Pin1 b = Pin2 cc = a ^ b IF cc = 1 THEN counter = counter + 1 ENDIF Main: GOTO Main ' ------------------------------------------------------------------------- ' Subroutine / Function Code ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' User Data ' ------------------------------------------------------------------------- ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=290897 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)