Hi Bob, thanks for the reply. I searched and could find nothing that I was able to understand. Can someone provide a little help?
Thanks in advance! ~ Dave
Hi Bob, thanks for the reply. I searched and could find nothing that I was able to understand. Can someone provide a little help?
Thanks in advance! ~ Dave
Hi Yankee. You can do it simply with your code. The following assumes porta is held high and your input switches have common negative. Portb.0 controls operation1. Portb.1 controls operation2.
START:
LOW PORTB.0 'cancel operation1
LOW PORTB.1 'cancel operation2
IF PORTA.0 = 0 THEN OPERATION1 'ignore switch #2 but if #1 switch on do operation1
GOTO START
OPERATION1:
IF PORTA.0 = 1 AND PORTA.1 = 1 THEN START 'both switches off cancel both operations
HIGH PORTB.0 'do operation 1
IF PORTA.1 = 0 THEN OPERATION2 '#2 switch on do operation2
GOTO OPERATION1
OPERATION2:
LOW PORTB.0 'cancel operation1
HIGH PORTB.1 'start operation2
IF PORTA.1 = 0 THEN OPERATION2 'ignore #1 switch & stay here if #2 switch on
GOTO START 'switch #2 off go home
OK, I'll try that out!
I'll tell you what, it isn't easy going from strictly analog for 25 years to digital. Maybe this old dog can learn some new tricks.
Thanks!
Bookmarks