Here is the code I came up with...
------------------------------------------------------
SYMBOL PORT_PIN = PORTA
X VAR BYTE ' For loop & bit index pointer
Wait:
IF PORTA.1 = 1 THEN GOTO Main 'checks if input recieves high signal
GOTO Wait
On:
ADCON1 = 7 ' All digital
PORTA = 0 ' Clear all port pins
PORTB = 0
PORTC = 0
TRISA = 0 ' Make them all outputs
TRISB = 0
TRISC = 0
FOR X = 0 TO 23
PORT_PIN.0[X] = 1 ' Set all porta, portb, and portc pins high
PAUSE 200
NEXT X
GOTO Off
Off:
ADCON1 = 7 ' All digital
PORTA = 0 ' Clear all port pins
PORTB = 0
PORTC = 0
TRISA = 0 ' Make them all outputs
TRISB = 0
TRISC = 0
FOR X = 0 TO 23
PORT_PIN.0[X] = 0 ' Set all porta, portb, and portc pins low
PAUSE 200
NEXT X
GOTO On
---------------------------------------------------
My only question now is, how do I set PORTA.1 to be an input? In my code I set all PORTA pins to be outputs. Is there a way I can set just PORTA.1 to be input?
As always, I appreciate your help.
-Brad
Bookmarks