Hi I have three inputs & three outputs.
PORTA1, 2, 3 – inputs
PORTB1, 2, 3 – outputs connected to 3 LED’s
The inputs coming from a digital logic IC.
Inputs coming like this
When PORTA1 = turn on PORTB1
When PORTA1 & PORTA2 = turn on PORTB2
When PORTA1 & PORTA2 & PORTA3 = turn on PORTB3
I want to detect the coming PORTA inputs. I know only to detect one input at a time & don’t know how to detect two or three inputs at a time.
Please help me
Thanks
PORTA1, 2, 3 – inputs
PORTB1, 2, 3 – outputs connected to 3 LED’s
The inputs coming from a digital logic IC.
Inputs coming like this
When PORTA1 = turn on PORTB1
When PORTA1 & PORTA2 = turn on PORTB2
When PORTA1 & PORTA2 & PORTA3 = turn on PORTB3
I want to detect the coming PORTA inputs. I know only to detect one input at a time & don’t know how to detect two or three inputs at a time.
Code:
SW1 btfss PORTA,1 ;check button1
goto SW2
goto LED1
SW2 btfss PORTA,2 ;check button2
goto SW3
goto LED2
SW3 btfss PORTA,3 ;check button3
goto SW1
goto LED3
LED1 bsf PORTB,1 ;turn on LED1
goto $-1
LED2 bsf PORTB,2 ;turn on LED2
goto $-1
LED3 bsf PORTB,3 ;turn on LED3
goto $-1
Please help me
Thanks