Quote Originally Posted by cncmachineguy View Post
I have a concern for you, in this bit of code
Code:
LOOP
PEEK CHSEL CHSELVAR
If CHSEL > CHSELVAR Then UP
Else 
PEEK CHSEL CHSELVAR
IF CHSEL < CHSELVAR Then DOWN
Else
GOTO Start
I think your intention is to set chselvar equal to the contents of address chsel. then in the next line you test to see if they are different. So if I am following this correctly, you will have to move the channel selector at the exact moment between the peek and the IF. May work better to set a var like chselvarold then on the next loop see if chselvar = chselvarold. if = then goto start, if not decode what to do.
What about if I don't recheck with Peek and do this instead;
CHLP:
PEEK CHSEL, CHSELVAR 'Look at the 4 input pins from the channel selector
If CHSEL > CHSELVAR Then UP 'if it's larger then run subroutine UP
IF CHSEL < CHSELVAR Then DOWN 'if it's smaller then run subroutine DOWN
GOTO Start 'if neither are true then goto start

What do you think?