
Originally Posted by
mackrackit
Why do you want to use the same variable name for two different things?
I am not using the same variable for two different things.
I have a subroutine that sends a special signal through a pin, and I need to be able to control which PIN the signal is sent through.
So the easiest way would be to do something like:
Code:
myPin = PORTB.1
gosub SendSignal
...
myPin = PORTA.1
Gosub SendSignal
...
myPin = PORTA.0
Gosub SendSignal
...
SendSignal:
...
HIGH myPin
(Do more stuff)
LOW myPin
Pause T
HIGH myPin
T = something
Pause T
Low myPin
(more stuff)
High myPin
Tf = T*something
Pause Tf
Low myPin
...
RETURN
Since the SendSignal routine is quite complex, I would like to implement it this way. I can't use a CASE SELECT either because everytime the routine has to do something with the pin, I would have to have a separate CASE block.
Any ideas?
Bookmarks