tou can make it that way:
Code:
TRISB = 0
INTCON = 0
X VAR BYTE
FOR X = 0 TO 7
PORTB.0[X] = 1
PAUSE 500
PORTB.0[X] = 0
PAUSE 500
NEXT X
END
tou can make it that way:
Code:
TRISB = 0
INTCON = 0
X VAR BYTE
FOR X = 0 TO 7
PORTB.0[X] = 1
PAUSE 500
PORTB.0[X] = 0
PAUSE 500
NEXT X
END
Last edited by crematory; - 2nd September 2005 at 17:35.
Hello,
Following the thread above, the code below does not work unless the value of k is made a constant as in: SOUND PORTC.5,[115,120,113,118]. I have never been able to use a variable to steer outputs to a specific pin. Any ideas?
pic16f8783
'sound on pin k port c
TRISC= %00000000
k var byte
start:
k=5
SOUND PORTC.0[k],[115,120,113,118]
GOTO START
"I don't know, Marge. Trying is the first step towards failure."
You should be able to use:
sound x,[115,120,113,118]
Where is x is between 0-15 with PORTA.0 being 0 and PORTC.7 being 15.
WOOHOO!
Thanks, yes that works, but I have never seen it written that ports A and C are linked and addressed this way. So then, PortC.5 is 13? I never would have thought of this. Is that only for the sound command? What about the addressing for port B.
"Asleep at the switch? I wasn't asleep, I was drunk."
Bookmarks