I have several outputs that are on different ports. I would like to use an array to cycle through the outputs, turning then on and off one at a time.
Is there a way to assign different port bits to an array?
Something like this: (I know this won't work but this kind of shows what I want to do)
Code:
'***********************************************
'* Configure Variables for Lights
'***********************************************
Lights VAR Bit[NoLights]
Lights[0] VAR PORTB.1
Lights[1] VAR PORTE.2
Lights[2] VAR PORTE.1
Lights[3] VAR PORTE.0
Lights[4] VAR PORTA.5
Lights[5] VAR PORTA.4
Then I would do something like this:
Code:
'turn off all the lights
for x = 0 to NoLights
Lights[x] = 0
next x
Thanks
Bookmarks