How can I use for next like PORTB.MYVARIABLE ???
'-------------[LED BLINKING SHOW]--------------
LED VAR BYTE ' Our variable name is LED.
TRISB = %0000000 ' All pins of port B are output.
PORTB = 0 ' initially turn off all leds.
LED=0 ' Make LED variable initially zero.
Loop:
FOR LED=0 to 7
HIGH PORTB.LED ' --> problem occured.
PAUSE 1000
LOW PORTB.LED ' --> problem occured.
PAUSE 1000
NEXT LED
GOTO Loop
End
IS there any simple way to do this???
Port Pin Steering Variable
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."